From eff9a7ff9188f81812770549d329d0447702abdd Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 Mar 2011 23:12:55 +0000 Subject: Teach CFGBuilder to prune trivially unreachable case statements. llvm-svn: 126797 --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp') 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. -- cgit v1.2.3