diff options
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index d27c41c4ef..08c7113cab 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -288,13 +288,14 @@ void GRExprEngine::ProcessSwitch(SwitchNodeBuilder& builder) { assert (V1 <= V2); } - else V2 = V1; + else + V2 = V1; // FIXME: Eventually we should replace the logic below with a range // comparison, rather than concretize the values within the range. // This should be easy once we have "ranges" for NonLVals. - do { + do { nonlval::ConcreteInt CaseVal(BasicVals.getValue(V1)); RVal Res = EvalBinOp(BinaryOperator::EQ, CondV, CaseVal); @@ -323,10 +324,14 @@ void GRExprEngine::ProcessSwitch(SwitchNodeBuilder& builder) { if (isFeasible) DefaultSt = StNew; - // Concretize the next value in the range. + // Concretize the next value in the range. + if (V1 == V2) + break; + ++V1; + assert (V1 < V2); - } while (V1 < V2); + } while (true); } // If we reach here, than we know that the default branch is |