From 722e2ea247b2ea914afe59a9807b01b8fa4f55cb Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 12 Jun 2018 20:54:11 +0000 Subject: Add null check to Intel JIT event listener llvm-svn: 334544 --- .../ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp index a9b9a63da5a..211f5216811 100644 --- a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp +++ b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp @@ -101,15 +101,17 @@ void IntelJITEventListener::NotifyObjectEmitted( const RuntimeDyld::LoadedObjectInfo &L) { OwningBinary DebugObjOwner = L.getObjectForDebug(Obj); - const ObjectFile &DebugObj = *DebugObjOwner.getBinary(); + const ObjectFile *DebugObj = DebugObjOwner.getBinary(); + if (!DebugObj) + return; // Get the address of the object image for use as a unique identifier - const void* ObjData = DebugObj.getData().data(); - std::unique_ptr Context = DWARFContext::create(DebugObj); + const void* ObjData = DebugObj->getData().data(); + std::unique_ptr Context = DWARFContext::create(*DebugObj); MethodAddressVector Functions; // Use symbol info to iterate functions in the object. - for (const std::pair &P : computeSymbolSizes(DebugObj)) { + for (const std::pair &P : computeSymbolSizes(*DebugObj)) { SymbolRef Sym = P.first; std::vector LineInfo; std::string SourceFileName; -- cgit v1.2.1