[PATCH] D69805: [Orc] Fix iterator usage after remove

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 14:21:24 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG007d173e2e0c: [Orc] Fix iterator usage after remove (authored by aganea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69805/new/

https://reviews.llvm.org/D69805

Files:
  llvm/lib/ExecutionEngine/Orc/Core.cpp


Index: llvm/lib/ExecutionEngine/Orc/Core.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1228,11 +1228,14 @@
       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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69805.228149.patch
Type: text/x-patch
Size: 756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191106/79d86bf1/attachment.bin>


More information about the llvm-commits mailing list