summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-12-29 18:37:03 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-12-29 18:37:03 +0000
commit550d900048fe018c2f51bdd993626c38a8351113 (patch)
tree85c395c7731a39b83b57d38e2ee6938223863a21
parent90b6344c56c514eb38a83a25e11dd8778e2ec1bc (diff)
downloadbcm5719-llvm-550d900048fe018c2f51bdd993626c38a8351113.tar.gz
bcm5719-llvm-550d900048fe018c2f51bdd993626c38a8351113.zip
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. llvm-svn: 224943
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 03f26dfa2e6..37a0b8fee1f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud