diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-11-15 22:59:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-11-15 22:59:22 +0000 |
commit | 18fb1665bfcb033f01d69836abf99f393866a53c (patch) | |
tree | 369e41107fa469259b2c0d7b67cc9cc94d64541b /clang/lib/Analysis/CFG.cpp | |
parent | bf9f2f2c29567e3b6a0e553e18295c9370c5d626 (diff) | |
download | bcm5719-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.cpp | 3 |
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()); } |