summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMichel Danzer <michel.daenzer@amd.com>2013-02-14 08:00:33 +0000
committerMichel Danzer <michel.daenzer@amd.com>2013-02-14 08:00:33 +0000
commitae0a403dab9dddcd9ba1ee20b691d8546c76ae00 (patch)
tree2c6138193f1ad84426cca78e6f59ea80c3a9681a /llvm/lib/Target
parent51d5eb2f631440fe6b5a524577b3d251b4592c6c (diff)
downloadbcm5719-llvm-ae0a403dab9dddcd9ba1ee20b691d8546c76ae00.tar.gz
bcm5719-llvm-ae0a403dab9dddcd9ba1ee20b691d8546c76ae00.zip
R600/SI: Check for empty stack in SIAnnotateControlFlow::isTopOfStack
Fixes assertion failure in newly added lit test. Might just be a bandaid that needs to be revisited. llvm-svn: 175139
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/R600/SIAnnotateControlFlow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp b/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
index f5803774186..2477e2a9dcc 100644
--- a/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
+++ b/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
@@ -147,7 +147,7 @@ bool SIAnnotateControlFlow::doInitialization(Module &M) {
/// \brief Is BB the last block saved on the stack ?
bool SIAnnotateControlFlow::isTopOfStack(BasicBlock *BB) {
- return Stack.back().first == BB;
+ return !Stack.empty() && Stack.back().first == BB;
}
/// \brief Pop the last saved value from the control flow stack
OpenPOWER on IntegriCloud