]> granicus.if.org Git - clang/commitdiff
Add an assertion to verify a container is non-empty before calling 'back()'
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Dec 2014 18:37:03 +0000 (18:37 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Dec 2014 18:37:03 +0000 (18:37 +0000)
This would've helped stabilize/deflake some failures that were seen
after some recent changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224943 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 03f26dfa2e65fb832f5dc38211b38104f45ffacc..37a0b8fee1fd9d9e17dcb5309b08ae24013e80d3 100644 (file)
@@ -2627,6 +2627,7 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
 
   // Don't bother if things are the same as last time.
   SourceManager &SM = CGM.getContext().getSourceManager();
+  assert(!LexicalBlockStack.empty());
   if (CurLoc == PrevLoc ||
       SM.getExpansionLoc(CurLoc) == SM.getExpansionLoc(PrevLoc))
     // New Builder may not be in sync with CGDebugInfo.