diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/Core.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp index 15c9578e691..123e5679ae2 100644 --- a/llvm/lib/ExecutionEngine/Orc/Core.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp @@ -1187,6 +1187,8 @@ void JITDylib::notifyFailed(const SymbolFlagsMap &FailedSymbols) { AsynchronousSymbolQuerySet FailedQueries; ES.runSessionLocked([&]() { + std::vector<const SymbolStringPtr *> MaterializerNamesToFail; + for (auto &KV : FailedSymbols) { auto &Name = KV.first; @@ -1207,6 +1209,7 @@ void JITDylib::notifyFailed(const SymbolFlagsMap &FailedSymbols) { continue; auto &MI = MII->second; + MaterializerNamesToFail.push_back(&KV.first); // Move all dependants to the error state and disconnect from them. for (auto &KV : MI.Dependants) { @@ -1261,9 +1264,9 @@ void JITDylib::notifyFailed(const SymbolFlagsMap &FailedSymbols) { Q->detach(); // Remove the MaterializingInfos. - for (auto &KV : FailedSymbols) { - assert(MaterializingInfos.count(KV.first) && "Expected MI for Name"); - MaterializingInfos.erase(KV.first); + while (!MaterializerNamesToFail.empty()) { + MaterializingInfos.erase(*MaterializerNamesToFail.back()); + MaterializerNamesToFail.pop_back(); } }); |