diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-20 19:13:53 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-20 19:13:53 +0000 |
commit | d4e07c973c6e02713ab330d6a8a4dd09520d76bd (patch) | |
tree | 79f4cc714bf9ec564ec48f8bc3e7677a347e07a6 /llvm/lib | |
parent | 18c97fa2a0b012c23c38fc67c3aca470398a2e26 (diff) | |
download | bcm5719-llvm-d4e07c973c6e02713ab330d6a8a4dd09520d76bd.tar.gz bcm5719-llvm-d4e07c973c6e02713ab330d6a8a4dd09520d76bd.zip |
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.)
llvm-svn: 232833
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 3c7cf9e1b8d..28244d67429 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/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)); |