[ORC] In RTDyldObjectLinkingLayer, only call NotifyFreed if the object file
authorLang Hames <lhames@gmail.com>
Fri, 21 Sep 2018 22:59:48 +0000 (22:59 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 21 Sep 2018 22:59:48 +0000 (22:59 +0000)
has been finalized.

This prevents crashes on unfinalized objects for clients using
JITEventListeners.

Patch by Geoff Levner. Thanks Geoff!

llvm-svn: 342783

llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h

index 532c833..2376f36 100644 (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();