]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove the ProgramState argument from ExprEngine::evalBind; we were ignori...
authorJordy Rose <jediknil@belkadan.com>
Sun, 28 Aug 2011 06:02:28 +0000 (06:02 +0000)
committerJordy Rose <jediknil@belkadan.com>
Sun, 28 Aug 2011 06:02:28 +0000 (06:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138720 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineC.cpp

index 7a3b3813015cd6733cc6c9bbfa39d45b4a285c96..b2c1c4a53a0370a4a0ff2537230a7d82a986a753 100644 (file)
@@ -420,8 +420,7 @@ protected:
   /// evalBind - Handle the semantics of binding a value to a specific location.
   ///  This method is used by evalStore, VisitDeclStmt, and others.
   void evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred,
-                const ProgramState *St, SVal location, SVal Val,
-                bool atDeclInit = false);
+                SVal location, SVal Val, bool atDeclInit = false);
 
 public:
   // FIXME: 'tag' should be removed, and a LocationContext should be used
index 59ca90ac588597a3c18ce2affc77036bfd2e3ff2..1a32d43d4d538bd5d9db921ead98f7df05017b44 100644 (file)
@@ -1276,12 +1276,8 @@ void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
 /// evalBind - Handle the semantics of binding a value to a specific location.
 ///  This method is used by evalStore and (soon) VisitDeclStmt, and others.
 void ExprEngine::evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE,
-                            ExplodedNode *Pred, const ProgramState *state,
-                            SVal location, SVal Val, bool atDeclInit) {
-
-  // FIXME: We probably shouldn't be passing a state and then dropping it on the
-  // floor, but while we are, we can at least assert that we're doing it right.
-  assert(state == Pred->getState());
+                          ExplodedNode *Pred,
+                          SVal location, SVal Val, bool atDeclInit) {
 
   // Do a previsit of the bind.
   ExplodedNodeSet CheckedSet;
@@ -1291,7 +1287,7 @@ void ExprEngine::evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE,
   for (ExplodedNodeSet::iterator I = CheckedSet.begin(), E = CheckedSet.end();
        I!=E; ++I) {
 
-    state = (*I)->getState();
+    const ProgramState *state = (*I)->getState();
 
     if (atDeclInit) {
       const VarRegion *VR =
@@ -1346,7 +1342,7 @@ void ExprEngine::evalStore(ExplodedNodeSet &Dst, const Expr *AssignE,
                                                    ProgramPoint::PostStoreKind);
 
   for (ExplodedNodeSet::iterator NI=Tmp.begin(), NE=Tmp.end(); NI!=NE; ++NI)
-    evalBind(Dst, StoreE, *NI, (*NI)->getState(), location, Val);
+    evalBind(Dst, StoreE, *NI, location, Val);
 }
 
 void ExprEngine::evalLoad(ExplodedNodeSet &Dst, const Expr *Ex,
index a4e640c0e98aa6725d408f01bbd057c1a41e33da..47debad09c3de2956aeef7975e1499b492c2a244 100644 (file)
@@ -361,8 +361,7 @@ void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
                                                    Builder->getCurrentBlockCount());
       }
       
-      evalBind(Dst, DS, N, state,
-               loc::MemRegionVal(state->getRegion(VD, LC)), InitVal, true);
+      evalBind(Dst, DS, N, state->getLValue(VD, LC), InitVal, true);
     }
     else {
       MakeNode(Dst, DS, N, state->bindDeclWithNoInit(state->getRegion(VD, LC)));