]> granicus.if.org Git - clang/commitdiff
Fix a serious bug: Tmp3 is the wrong destination set. We should create a new
authorZhongxing Xu <xuzhongxing@gmail.com>
Tue, 19 Jan 2010 09:25:53 +0000 (09:25 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Tue, 19 Jan 2010 09:25:53 +0000 (09:25 +0000)
intermediate destination set Tmp4.

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

include/clang/Analysis/PathSensitive/CheckerVisitor.h
lib/Analysis/GRExprEngine.cpp

index f5145bbb7a675202a3931597a625895ab731c840..37ec8def50b35da5f246b0505cebc5f1e4f9738c 100644 (file)
@@ -66,6 +66,11 @@ break;
       default:
         assert(false && "Unsupport statement.");
         return;
+      case Stmt::CompoundAssignOperatorClass:
+        static_cast<ImplClass*>(this)->PostVisitBinaryOperator(C,
+                                         static_cast<const BinaryOperator*>(S));
+        break;
+
 #define POSTVISIT(NAME, FALLBACK) \
 case Stmt::NAME ## Class:\
 static_cast<ImplClass*>(this)->\
index 40c12c9fec84ffc30318b7b9a954a05fc7fe68b4..b2229a268c8e2dc6c1b798b0094a4e86968d9e5e 100644 (file)
@@ -2952,13 +2952,13 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
 
       // Perform a load (the LHS).  This performs the checks for
       // null dereferences, and so on.
-      ExplodedNodeSet Tmp3;
+      ExplodedNodeSet Tmp4;
       SVal location = state->getSVal(LHS);
-      EvalLoad(Tmp3, LHS, *I2, state, location);
+      EvalLoad(Tmp4, LHS, *I2, state, location);
 
-      for (ExplodedNodeSet::iterator I3=Tmp3.begin(), E3=Tmp3.end(); I3!=E3;
-           ++I3) {
-        state = GetState(*I3);
+      for (ExplodedNodeSet::iterator I4=Tmp4.begin(), E4=Tmp4.end(); I4!=E4;
+           ++I4) {
+        state = GetState(*I4);
         SVal V = state->getSVal(LHS);
 
         // Get the computation type.
@@ -3008,7 +3008,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
           llvm::tie(state, LHSVal) = SVator.EvalCast(Result, state, LTy, CTy);
         }
 
-        EvalStore(Tmp3, B, LHS, *I3, state->BindExpr(B, Result),
+        EvalStore(Tmp3, B, LHS, *I4, state->BindExpr(B, Result),
                   location, LHSVal);
       }
     }