[llvm] 007d173 - [Orc] Fix iterator usage after remove
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 14:18:03 PST 2019
Author: Alexandre Ganea
Date: 2019-11-06T17:17:27-05:00
New Revision: 007d173e2e0c29903bc17a9d5108f531a6f2ea4d
URL: https://github.com/llvm/llvm-project/commit/007d173e2e0c29903bc17a9d5108f531a6f2ea4d
DIFF: https://github.com/llvm/llvm-project/commit/007d173e2e0c29903bc17a9d5108f531a6f2ea4d.diff
LOG: [Orc] Fix iterator usage after remove
Differential Revision: https://reviews.llvm.org/D69805
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/Core.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 5c7d888c2d6e..9e024ba0f10f 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1228,11 +1228,14 @@ void JITDylib::notifyFailed(FailedSymbolsWorklist Worklist) {
MI.UnemittedDependencies.clear();
// Collect queries to be failed for this MII.
+ AsynchronousSymbolQueryList ToDetach;
for (auto &Q : MII->second.pendingQueries()) {
// Add the query to the list to be failed and detach it.
FailedQueries.insert(Q);
- Q->detach();
+ ToDetach.push_back(Q);
}
+ for (auto &Q : ToDetach)
+ Q->detach();
assert(MI.Dependants.empty() &&
"Can not delete MaterializingInfo with dependants still attached");
More information about the llvm-commits
mailing list