]> granicus.if.org Git - clang/commitdiff
[analyzer] Propagate the checker's state from checkBranchCondition
authorAnna Zaks <ganna@apple.com>
Fri, 14 Dec 2012 19:08:20 +0000 (19:08 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 14 Dec 2012 19:08:20 +0000 (19:08 +0000)
Fixes a bug, where we were dropping the state modifications from the
checkBranchCondition checker callback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170232 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 26575732c108e1a4ec14d5efa8e1ee000af27210..5c91dd288fab52593bf16a7666b62553c99a0373 100644 (file)
@@ -1217,8 +1217,8 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
     if (PredI->isSink())
       continue;
 
-    ProgramStateRef PrevState = Pred->getState();
-    SVal X = PrevState->getSVal(Condition, Pred->getLocationContext());
+    ProgramStateRef PrevState = PredI->getState();
+    SVal X = PrevState->getSVal(Condition, PredI->getLocationContext());
 
     if (X.isUnknownOrUndef()) {
       // Give it a chance to recover from unknown.
@@ -1230,7 +1230,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
           // underlying value and use that instead.
           SVal recovered = RecoverCastedSymbol(getStateManager(),
                                                PrevState, Condition,
-                                               Pred->getLocationContext(),
+                                               PredI->getLocationContext(),
                                                getContext());
 
           if (!recovered.isUnknown()) {