]> granicus.if.org Git - llvm/commitdiff
Merging r226588:
authorHans Wennborg <hans@hanshq.net>
Thu, 12 Feb 2015 23:45:01 +0000 (23:45 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 12 Feb 2015 23:45:01 +0000 (23:45 +0000)
------------------------------------------------------------------------
r226588 | adrian | 2015-01-20 10:03:37 -0800 (Tue, 20 Jan 2015) | 1 line

Add an assertion and prefer a crash over an infinite loop.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@228984 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DebugInfo.cpp

index 290dbe29c707c903c0bdfe30e1e6dd94edd6169d..443db5eec468cf0fac0fa1f13ea9b92e93d16efe 100644 (file)
@@ -525,12 +525,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;