]> granicus.if.org Git - clang/commitdiff
Fixed a bug where the values of block-level expressions were being recorded in
authorTed Kremenek <kremenek@apple.com>
Thu, 24 Jan 2008 19:28:01 +0000 (19:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 24 Jan 2008 19:28:01 +0000 (19:28 +0000)
the value map as if the expressions were non-block-level expressions.

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

Analysis/GRConstants.cpp

index 35758c672e79ea9c42ba9e144f4a86bd0cb56d04..9db8e7f19603c79ff281f27de0610642735596f4 100644 (file)
@@ -608,8 +608,7 @@ public:
   ///  mappings removed.
   StateTy RemoveDeadBindings(Stmt* S, StateTy M);
 
-  StateTy SetValue(StateTy St, Stmt* S, const ExprValue& V,
-                   bool isBlkExpr = false);
+  StateTy SetValue(StateTy St, Stmt* S, const ExprValue& V);
 
   StateTy SetValue(StateTy St, const LValue& LV, const ExprValue& V);
   
@@ -726,13 +725,15 @@ LValue GRConstants::GetLValue(const StateTy& St, Stmt* S) {
 }
 
 GRConstants::StateTy GRConstants::SetValue(StateTy St, Stmt* S,
-                                           const ExprValue& V, bool isBlkExpr) {
+                                           const ExprValue& V) {
   
   if (!StateCleaned) {
     St = RemoveDeadBindings(CurrentStmt, St);
     StateCleaned = true;
   }
   
+  bool isBlkExpr = S == CurrentStmt && getCFG().isBlkExpr(S);
+  
   return V.isValid() ? StateMgr.Add(St, ValueKey(S,isBlkExpr), V)
                      : St;
 }