DebugLocs without a scope should fail the verification.
Follow-up to r226588.
llvm-svn: 226616
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 0dd46b7..9003fff 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -527,15 +527,15 @@
while ((IA = DL.getInlinedAt()))
DL = DebugLoc::getFromDILocation(IA);
DL.getScopeAndInlinedAt(Scope, IA);
- assert(Scope && "debug location has no scope");
+ if (!Scope)
+ return false;
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");
+ assert(Scope && "lexical block file has no scope");
}
if (!DISubprogram(Scope).describes(F))
return false;