diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-20 22:37:25 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-20 22:37:25 +0000 |
commit | de200dfad2fc116d384f30a603cccfad769186e0 (patch) | |
tree | 4f0a7c124254a26739894b612e5ef2587c8f77d4 /llvm/lib/IR/DebugInfo.cpp | |
parent | 4ac5a9e92cbb0171232606f5f104cd60191e7206 (diff) | |
download | bcm5719-llvm-de200dfad2fc116d384f30a603cccfad769186e0.tar.gz bcm5719-llvm-de200dfad2fc116d384f30a603cccfad769186e0.zip |
DebugLocs without a scope should fail the verification.
Follow-up to r226588.
llvm-svn: 226616
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 0dd46b7619c..9003fff7071 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -527,15 +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"); + 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; |