diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-01 23:12:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-01 23:12:55 +0000 |
commit | e71f3d587844110d836c82250830b27b1651afdb (patch) | |
tree | 732e9e5c56ba47ab23ff77d05a76e17c09cee8d4 /lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 8a04585eba8a87a660c9030c9cdef34c8c9f85c6 (diff) |
Teach CFGBuilder to prune trivially unreachable case statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 615c216b01..95d339ff82 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/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. |