r224943 - Add an assertion to verify a container is non-empty before calling 'back()'

David Blaikie dblaikie at gmail.com
Mon Dec 29 10:37:03 PST 2014


Author: dblaikie
Date: Mon Dec 29 12:37:03 2014
New Revision: 224943

URL: http://llvm.org/viewvc/llvm-project?rev=224943&view=rev
Log:
Add an assertion to verify a container is non-empty before calling 'back()'

This would've helped stabilize/deflake some failures that were seen
after some recent changes.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=224943&r1=224942&r2=224943&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Dec 29 12:37:03 2014
@@ -2627,6 +2627,7 @@ void CGDebugInfo::EmitLocation(CGBuilder
 
   // 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.





More information about the cfe-commits mailing list