summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-08-22 22:36:40 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-08-22 22:36:40 +0000
commit3c338f3a7e224f6da82e3adc1bbff9c0265d59e0 (patch)
tree48b1b855e5df9d34a50bbd3767aa200a6d1572e9 /llvm/lib/IR/Verifier.cpp
parentcd31b85c12456c07d3f01e85eea88d690445c24d (diff)
downloadbcm5719-llvm-3c338f3a7e224f6da82e3adc1bbff9c0265d59e0.tar.gz
bcm5719-llvm-3c338f3a7e224f6da82e3adc1bbff9c0265d59e0.zip
Verifier: Don't crash on null entries in debug info retained types list
There was already a good error path for this. Added a test for it & made a minor code change to ensure the error path was actually reached, rather than crashing before we got that far. llvm-svn: 245795
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index af1121e3c73..813d06cf643 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3782,7 +3782,7 @@ void Verifier::verifyTypeRefs() {
for (auto *CU : CUs->operands())
if (auto Ts = cast<DICompileUnit>(CU)->getRetainedTypes())
for (DIType *Op : Ts)
- if (auto *T = dyn_cast<DICompositeType>(Op))
+ if (auto *T = dyn_cast_or_null<DICompositeType>(Op))
if (auto *S = T->getRawIdentifier()) {
UnresolvedTypeRefs.erase(S);
TypeRefs.insert(std::make_pair(S, T));
OpenPOWER on IntegriCloud