summaryrefslogtreecommitdiff
path: root/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-02-14 12:17:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-02-14 12:17:42 +0000
commit608e665946afc2b89050fcf0b99070db2c006bee (patch)
treed332f023fbc1365c9129fe463cb61d4147ac16ec /lib/IR/DebugInfo.cpp
parentec304151b74f9254d7029ee4d197ce1f7cbe501a (diff)
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r--lib/IR/DebugInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index 290dbe29c707..71b43942e882 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -525,12 +525,15 @@ bool DISubprogram::Verify() const {
while ((IA = DL.getInlinedAt()))
DL = DebugLoc::getFromDILocation(IA);
DL.getScopeAndInlinedAt(Scope, IA);
+ if (!Scope)
+ return false;
assert(!IA);
while (!DIDescriptor(Scope).isSubprogram()) {
DILexicalBlockFile D(Scope);
Scope = D.isLexicalBlockFile()
? D.getScope()
: DebugLoc::getFromDILexicalBlock(Scope).getScope();
+ assert(Scope && "lexical block file has no scope");
}
if (!DISubprogram(Scope).describes(F))
return false;