From daadf450d0dc51a45cd6610ee09060a6b98d6ecf Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 24 Jan 2008 19:28:01 +0000 Subject: [PATCH] Fixed a bug where the values of block-level expressions were being recorded in 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp index 35758c672e..9db8e7f196 100644 --- a/Analysis/GRConstants.cpp +++ b/Analysis/GRConstants.cpp @@ -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; } -- 2.50.1