From: Duncan P. N. Exon Smith Date: Fri, 20 Mar 2015 19:13:53 +0000 (+0000) Subject: DebugInfoFinder: Check for null imported entities X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c867853c90e82250e3dbf35d9ce8a1ab4c331ab4;p=oota-llvm.git DebugInfoFinder: Check for null imported entities Don't use the accessors in `DIImportedEntity` on a null pointer. (A WIP patch to make `DIDescriptor` accessors more strict crashes here otherwise.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232833 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 3c7cf9e1b8d..28244d67429 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -674,6 +674,8 @@ void DebugInfoFinder::processModule(const Module &M) { DIArray Imports = CU.getImportedEntities(); for (unsigned i = 0, e = Imports.getNumElements(); i != e; ++i) { DIImportedEntity Import = DIImportedEntity(Imports.getElement(i)); + if (!Import) + continue; DIDescriptor Entity = Import.getEntity().resolve(TypeIdentifierMap); if (Entity.isType()) processType(DIType(Entity));