[ORC] Capture JD by value in MachOPlatform::pushInitializersLoop.
authorLang Hames <lhames@gmail.com>
Fri, 11 Nov 2022 05:32:31 +0000 (21:32 -0800)
committerLang Hames <lhames@gmail.com>
Sat, 12 Nov 2022 00:01:25 +0000 (16:01 -0800)
The lambda may run after pushInitializersLoop returns.

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

index 01a4c3b..29bf864 100644 (file)
@@ -479,7 +479,7 @@ void MachOPlatform::pushInitializersLoop(
 
   // Otherwise issue a lookup and re-run this phase when it completes.
   lookupInitSymbolsAsync(
-      [this, SendResult = std::move(SendResult), &JD](Error Err) mutable {
+      [this, SendResult = std::move(SendResult), JD](Error Err) mutable {
         if (Err)
           SendResult(std::move(Err));
         else