diff options
author | Lang Hames <lhames@gmail.com> | 2017-08-30 00:47:42 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2017-08-30 00:47:42 +0000 |
commit | 5409d95d5b6247d0e6995b3c662f20b18e885be6 (patch) | |
tree | 894589cd5f65425d718f7bed2dc2ed59357a2374 | |
parent | b1efc9b410eaa946a46bd20eb989aea126889916 (diff) | |
download | bcm5719-llvm-5409d95d5b6247d0e6995b3c662f20b18e885be6.tar.gz bcm5719-llvm-5409d95d5b6247d0e6995b3c662f20b18e885be6.zip |
[Orc] Fix member variable ordering issue in OrcMCJITReplacement.
https://reviews.llvm.org/D36888
From that review description:
When an OrcMCJITReplacement object gets destructed, LazyEmitLayer may still
contain a shared_ptr of a module, which requires ShouldDelete in the deleter.
But ShouldDelete gets destructed before LazyEmitLayer due to the order of
declaration in OrcMCJITReplacement, which leads to a crash, when the destructor
of LazyEmitLayer is executed. Changing the order of declaration fixes this.
Patch by Moritz Kroll. Thanks Moritz!
llvm-svn: 312086
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index a24f92b82fb..743d5e2307c 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -381,6 +381,9 @@ private: std::shared_ptr<JITSymbolResolver> ClientResolver; Mangler Mang; + std::map<Module*, bool> ShouldDelete; + std::vector<std::shared_ptr<Module>> LocalModules; + NotifyObjectLoadedT NotifyObjectLoaded; NotifyFinalizedT NotifyFinalized; @@ -402,8 +405,6 @@ private: std::map<ObjectLayerT::ObjHandleT, SectionAddrSet, ObjHandleCompare> UnfinalizedSections; - std::map<Module*, bool> ShouldDelete; - std::vector<std::shared_ptr<Module>> LocalModules; std::vector<object::OwningBinary<object::Archive>> Archives; }; |