From 431d80c13a3f1a72882bd06671f2f25b87545582 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 29 Dec 2014 18:37:03 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224943 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 03f26dfa2e..37a0b8fee1 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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. -- 2.40.0