[llvm] r350886 - Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 10 12:12:09 PST 2019
Author: sanjoy
Date: Thu Jan 10 12:12:09 2019
New Revision: 350886
URL: http://llvm.org/viewvc/llvm-project?rev=350886&view=rev
Log:
Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer
Reviewers: lhames
Subscribers: mcrosier, jlebar, bixia, llvm-commits
Differential Revision: https://reviews.llvm.org/D56521
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h?rev=350886&r1=350885&r2=350886&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h Thu Jan 10 12:12:09 2019
@@ -443,11 +443,14 @@ public:
private:
ExecutionSession &ES;
- std::map<VModuleKey, std::unique_ptr<LinkedObject>> LinkedObjects;
ResourcesGetter GetResources;
NotifyLoadedFtor NotifyLoaded;
NotifyFinalizedFtor NotifyFinalized;
NotifyFreedFtor NotifyFreed;
+
+ // NB! `LinkedObjects` needs to be destroyed before `NotifyFreed` because
+ // `~ConcreteLinkedObject` calls `NotifyFreed`
+ std::map<VModuleKey, std::unique_ptr<LinkedObject>> LinkedObjects;
bool ProcessAllSections = false;
};
More information about the llvm-commits
mailing list