summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-01-21 18:32:56 +0000
committerAdrian Prantl <aprantl@apple.com>2015-01-21 18:32:56 +0000
commit1292e24d0e10720b3bac7506398f96c2a2ebed6c (patch)
tree7e4383df235760c5531c82816f95678017a02cb8 /llvm/lib/IR/DebugInfo.cpp
parent02b882a69beff06967f0c093003b30da7ef70dcd (diff)
downloadbcm5719-llvm-1292e24d0e10720b3bac7506398f96c2a2ebed6c.tar.gz
bcm5719-llvm-1292e24d0e10720b3bac7506398f96c2a2ebed6c.zip
Let subprograms with instructions without parent scopes fail the
verification. Tested via a unit test. Follow-up to r226616. llvm-svn: 226684
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 5dff50d362f..76836fd9551 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -536,7 +536,8 @@ bool DISubprogram::Verify() const {
Scope = D.isLexicalBlockFile()
? D.getScope()
: DebugLoc::getFromDILexicalBlock(Scope).getScope();
- assert(Scope && "lexical block file has no scope");
+ if (!Scope)
+ return false;
}
if (!DISubprogram(Scope).describes(F))
return false;
OpenPOWER on IntegriCloud