aboutsummaryrefslogtreecommitdiff
path: root/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
commite4ae4dc87fa57e3062077514964b6d75bfa1fed1 (patch)
treeb49b51ff5b140ea3b88fae463c01c3ffe6a3944e /lib/Analysis/CFG.cpp
parent82f3c50fa163f99d1407849e556d3859a09afd78 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r--lib/Analysis/CFG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index ef67d3b957..b58e9826d3 100644
--- a/lib/Analysis/CFG.cpp
+++ b/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());
}