summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-11-15 22:59:22 +0000
committerTed Kremenek <kremenek@apple.com>2010-11-15 22:59:22 +0000
commit18fb1665bfcb033f01d69836abf99f393866a53c (patch)
tree369e41107fa469259b2c0d7b67cc9cc94d64541b /clang/lib/Analysis/CFG.cpp
parentbf9f2f2c29567e3b6a0e553e18295c9370c5d626 (diff)
downloadbcm5719-llvm-18fb1665bfcb033f01d69836abf99f393866a53c.tar.gz
bcm5719-llvm-18fb1665bfcb033f01d69836abf99f393866a53c.zip
Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn' functions. Fixes assertion failure reported in PR 8619. llvm-svn: 119284
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index ef67d3b9576..b58e9826d33 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -1204,7 +1204,8 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(ConditionalOperator *C,
// want the first predecessor to the the block containing the expression
// for the case when the ternary expression evaluates to true.
AddSuccessor(Block, ConfluenceBlock);
- assert(ConfluenceBlock->pred_size() == 2);
+ // Note that there can possibly only be one predecessor if one of the
+ // subexpressions resulted in calling a noreturn function.
std::reverse(ConfluenceBlock->pred_begin(),
ConfluenceBlock->pred_end());
}
OpenPOWER on IntegriCloud