diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-20 18:03:37 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-20 18:03:37 +0000 |
commit | f88b2c8c74449bde25e17381bc5036b979927a59 (patch) | |
tree | 681d711222980992b4bfb99b9ed9fbf07d848500 /llvm/lib/IR/DebugInfo.cpp | |
parent | 2d53c31eb799b544fe28e82c8cd3f683d8e37e9a (diff) | |
download | bcm5719-llvm-f88b2c8c74449bde25e17381bc5036b979927a59.tar.gz bcm5719-llvm-f88b2c8c74449bde25e17381bc5036b979927a59.zip |
Add an assertion and prefer a crash over an infinite loop.
llvm-svn: 226588
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 3 |
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; |