[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.
This commit is contained in:
Lang Hames 2020-09-01 19:55:19 -07:00
parent 057028ed39
commit 7ff335a25f
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}