summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index c5c11157971..0dd46b7619c 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -527,12 +527,15 @@ bool DISubprogram::Verify() const {
while ((IA = DL.getInlinedAt()))
DL = DebugLoc::getFromDILocation(IA);
DL.getScopeAndInlinedAt(Scope, IA);
+ assert(Scope && "debug location has no scope");
assert(!IA);
while (!DIDescriptor(Scope).isSubprogram()) {
DILexicalBlockFile D(Scope);
Scope = D.isLexicalBlockFile()
? D.getScope()
: DebugLoc::getFromDILexicalBlock(Scope).getScope();
+ if (!Scope)
+ llvm_unreachable("lexical block file has no scope");
}
if (!DISubprogram(Scope).describes(F))
return false;
OpenPOWER on IntegriCloud