[llvm] 7ff335a - [ORC] Fix MachOPlatform's synthetic symbol dependence registration.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 20:12:34 PDT 2020


Author: Lang Hames
Date: 2020-09-01T20:12:23-07:00
New Revision: 7ff335a25f80b8be3a1d8dd08b30453201dac132

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

LOG: [ORC] Fix MachOPlatform's synthetic symbol dependence registration.

A think-o in the existing code meant that dependencies were never registered.
This failure could lead to crashes rather than orderly error propagation if
initialization dependencies failed to materialize.

No test case: The bug was discovered in an out-of-tree code and requires
pathalogically misconfigured JIT to generate the original error that lead to
the crash.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
index 2d6435f8dff1..9ad2577d4174 100644
--- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -305,7 +305,7 @@ void MachOPlatform::InitScraperPlugin::modifyPassConfig(
     preserveInitSectionIfPresent(InitSectionSymbols, G, "__objc_selrefs");
     preserveInitSectionIfPresent(InitSectionSymbols, G, "__objc_classlist");
 
-    if (!InitSymbolDeps.empty()) {
+    if (!InitSectionSymbols.empty()) {
       std::lock_guard<std::mutex> Lock(InitScraperMutex);
       InitSymbolDeps[&MR] = std::move(InitSectionSymbols);
     }


        


More information about the llvm-commits mailing list