]> granicus.if.org Git - clang/commitdiff
Fixed analyzer caching bug involving the transfer function for loads.
authorTed Kremenek <kremenek@apple.com>
Thu, 28 Aug 2008 18:43:46 +0000 (18:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 28 Aug 2008 18:43:46 +0000 (18:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55494 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 4f09c9089bb00e4364d7bde57fadac554f32d8f4..2211f3a4d9333b3e2cc56e6d64b9c8af795ae17e 100644 (file)
@@ -230,7 +230,8 @@ public:
   }
   
   NodeTy* MakeNode(ExplodedNodeSet<StateTy>& Dst, Stmt* S,
-                   NodeTy* Pred, const StateTy* St) {    
+                   NodeTy* Pred, const StateTy* St,
+                   ProgramPoint::Kind K = ProgramPoint::PostStmtKind) {    
     
     const StateTy* PredState = GetState(Pred);
         
@@ -240,7 +241,7 @@ public:
       return NULL;
     }
     
-    NodeTy* N = generateNode(S, St, Pred);
+    NodeTy* N = generateNode(S, St, Pred, K);
     
     if (N) {      
       if (BuildSinks)
index 7cd345d2338db208a40e962edcaa28e8b4c1aa4a..b1f4e70d39b8a86dcd13e0aba7e0286c2eb56e77 100644 (file)
@@ -442,9 +442,10 @@ protected:
     return StateMgr.Assume(St, Cond, Assumption, isFeasible);
   }
 
-  NodeTy* MakeNode(NodeSet& Dst, Stmt* S, NodeTy* Pred, const GRState* St) {
+  NodeTy* MakeNode(NodeSet& Dst, Stmt* S, NodeTy* Pred, const GRState* St,
+                   ProgramPoint::Kind K = ProgramPoint::PostStmtKind) {
     assert (Builder && "GRStmtNodeBuilder not present.");
-    return Builder->MakeNode(Dst, S, Pred, St);
+    return Builder->MakeNode(Dst, S, Pred, St, K);
   }
     
   /// Visit - Transfer function logic for all statements.  Dispatches to
index 75ba46051ffd9af1e3735ed6f44453dcf67471f2..affb02a962a75717342bcf7cde7fa38e7ed7996d 100644 (file)
@@ -954,22 +954,23 @@ void GRExprEngine::EvalLoad(NodeSet& Dst, Expr* Ex, NodeTy* Pred,
     return;
   
   // Proceed with the load.
+  ProgramPoint::Kind K = ProgramPoint::PostLoadKind;
 
   // FIXME: Currently symbolic analysis "generates" new symbols
   //  for the contents of values.  We need a better approach.
 
   // FIXME: The "CheckOnly" option exists only because Array and Field
   //  loads aren't fully implemented.  Eventually this option will go away.
-  
+
   if (CheckOnly)
-    MakeNode(Dst, Ex, Pred, St);
+    MakeNode(Dst, Ex, Pred, St, K);
   else if (location.isUnknown()) {
     // This is important.  We must nuke the old binding.
-    MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal()));
+    MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal()), K);
   }
   else    
     MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, GetRVal(St, cast<LVal>(location),
-                                                    Ex->getType())));  
+                                                    Ex->getType())), K);  
 }
 
 const GRState* GRExprEngine::EvalLocation(Expr* Ex, NodeTy* Pred,