summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-01 23:12:55 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-01 23:12:55 +0000
commiteff9a7ff9188f81812770549d329d0447702abdd (patch)
treeeba5072b11f6500f46596d18b3785db2c8e99907 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
parent98a3c80a3ebdca2379fab4ae225512bb1d20a3bd (diff)
downloadbcm5719-llvm-eff9a7ff9188f81812770549d329d0447702abdd.tar.gz
bcm5719-llvm-eff9a7ff9188f81812770549d329d0447702abdd.zip
Teach CFGBuilder to prune trivially unreachable case statements.
llvm-svn: 126797
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 615c216b019..95d339ff827 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1043,6 +1043,10 @@ void ExprEngine::processSwitch(SwitchNodeBuilder& builder) {
bool defaultIsFeasible = I == EI;
for ( ; I != EI; ++I) {
+ // Successor may be pruned out during CFG construction.
+ if (!I.getBlock())
+ continue;
+
const CaseStmt* Case = I.getCase();
// Evaluate the LHS of the case value.
OpenPOWER on IntegriCloud