summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-20 19:13:53 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-20 19:13:53 +0000
commitd4e07c973c6e02713ab330d6a8a4dd09520d76bd (patch)
tree79f4cc714bf9ec564ec48f8bc3e7677a347e07a6 /llvm/lib
parent18c97fa2a0b012c23c38fc67c3aca470398a2e26 (diff)
downloadbcm5719-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.cpp2
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));
OpenPOWER on IntegriCloud