[llvm] f99746f - [Orc][RuntimeDyld] Return after handling error (#95364)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 02:06:52 PDT 2024


Author: Nikita Popov
Date: 2024-07-04T11:06:48+02:00
New Revision: f99746f30a125324500cc7a46829fcfd44bed3dc

URL: https://github.com/llvm/llvm-project/commit/f99746f30a125324500cc7a46829fcfd44bed3dc
DIFF: https://github.com/llvm/llvm-project/commit/f99746f30a125324500cc7a46829fcfd44bed3dc.diff

LOG: [Orc][RuntimeDyld] Return after handling error (#95364)

If OnLoaded failed, return after passing the error to OnEmitted instead
of also calling finalizeAsync (which would use values that have already
been moved and perform another call to OnEmitted).

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index a9aaff42433f6..79a190f447879 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -1466,8 +1466,10 @@ void jitLinkForORC(
     return;
   }
 
-  if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable()))
+  if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable())) {
     OnEmitted(std::move(O), std::move(Info), std::move(Err));
+    return;
+  }
 
   RuntimeDyldImpl::finalizeAsync(std::move(RTDyld.Dyld), std::move(OnEmitted),
                                  std::move(O), std::move(Info));


        


More information about the llvm-commits mailing list