[ORC] In RTDyldObjectLinkingLayer, only call NotifyFreed if the object file

has been finalized.

This prevents crashes on unfinalized objects for clients using
JITEventListeners.

Patch by Geoff Levner. Thanks Geoff!

llvm-svn: 342783
This commit is contained in:
Lang Hames 2018-09-21 22:59:48 +00:00
parent 628d161d70
commit f2c678b710

View File

@ -203,7 +203,7 @@ private:
}
~ConcreteLinkedObject() override {
if (this->Parent.NotifyFreed)
if (this->Parent.NotifyFreed && ObjForNotify.getBinary())
this->Parent.NotifyFreed(K, *ObjForNotify.getBinary());
MemMgr->deregisterEHFrames();