diff --git a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h index 5548a5bf29e7..0d8dfb320267 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -602,6 +602,13 @@ protected: TF->EvalObjCMessageExpr(Dst, *this, *Builder, ME, Pred); } + void EvalStore(NodeSet& Dst, Expr* E, NodeTy* Pred, ValueState* St, + LVal TargetLV, RVal Val) { + + assert (Builder && "GRStmtNodeBuilder must be defined."); + MakeNode(Dst, E, Pred, SetRVal(St, TargetLV, Val)); + } + ValueState* MarkBranch(ValueState* St, Stmt* Terminator, bool branchTaken); }; } // end clang namespace diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index dfe319f0c95b..9c6a37dbadf0 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1637,8 +1637,11 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, // Simulate the effects of a "store": bind the value of the RHS // to the L-Value represented by the LHS. - St = SetRVal(SetRVal(St, B, RightV), cast(LeftV), RightV); - break; + EvalStore(Dst, B, N2, SetRVal(St, B, RightV), + cast(LeftV), RightV); + +// St = SetRVal(SetRVal(St, B, RightV), cast(LeftV), RightV); + continue; } // Compound assignment operators. @@ -1784,7 +1787,9 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, continue; } - St = SetRVal(SetRVal(St, B, Result), LeftLV, Result); + // St = SetRVal(SetRVal(St, B, Result), LeftLV, Result); + EvalStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result); + continue; } }