Add null check to Intel JIT event listener

llvm-svn: 334544
This commit is contained in:
Reid Kleckner 2018-06-12 20:54:11 +00:00
parent 8e42bfd41c
commit 722e2ea247
1 changed files with 6 additions and 4 deletions

View File

@ -101,15 +101,17 @@ void IntelJITEventListener::NotifyObjectEmitted(
const RuntimeDyld::LoadedObjectInfo &L) {
OwningBinary<ObjectFile> 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<DIContext> Context = DWARFContext::create(DebugObj);
const void* ObjData = DebugObj->getData().data();
std::unique_ptr<DIContext> Context = DWARFContext::create(*DebugObj);
MethodAddressVector Functions;
// Use symbol info to iterate functions in the object.
for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(*DebugObj)) {
SymbolRef Sym = P.first;
std::vector<LineNumberInfo> LineInfo;
std::string SourceFileName;