Commit e27e03b9 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r226588:

------------------------------------------------------------------------
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.
------------------------------------------------------------------------

llvm-svn: 228984
parent 6a4ed8e3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;