[cfe-commits] r50466 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Tue Apr 29 21:23:07 PDT 2008


Author: kremenek
Date: Tue Apr 29 23:23:07 2008
New Revision: 50466

URL: http://llvm.org/viewvc/llvm-project?rev=50466&view=rev
Log:
Invalidate old subexpression bindings when binding UnknownVal.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=50466&r1=50465&r2=50466&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Apr 29 23:23:07 2008
@@ -157,7 +157,7 @@
       return St;
   }
 
-  return StateMgr.SetRVal(St, Ex, V, isBlkExpr, false);
+  return StateMgr.SetRVal(St, Ex, V, isBlkExpr, true);
 }
 
 //===----------------------------------------------------------------------===//
@@ -890,8 +890,12 @@
   // FIXME: The "CheckOnly" option exists only because Array and Field
   //  loads aren't fully implemented.  Eventually this option will go away.
   
-  if (location.isUnknown() || CheckOnly)
+  if (CheckOnly)
     MakeNode(Dst, Ex, Pred, St);
+  else if (location.isUnknown()) {
+    // This is important.  We must nuke the old binding.
+    MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal()));
+  }
   else    
     MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, GetRVal(St, cast<LVal>(location),
                                                     Ex->getType())));  
@@ -1593,7 +1597,7 @@
       St = SetRVal(St, U, U->isPostfix() ? V2 : Result);
 
       // Perform the store.      
-      EvalStore(Dst, U, *I, St, V1, Result);
+      EvalStore(Dst, U, *I2, St, V1, Result);
     }
   }
 }





More information about the cfe-commits mailing list