diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index 7c1d3134538..ca960142ee3 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -3241,8 +3241,14 @@ void ExprEngine::VisitBinaryOperator(const BinaryOperator* B, LHSVal = svalBuilder.evalCast(Result, LTy, CTy); } - evalStore(Tmp3, B, LHS, *I4, state->BindExpr(B, Result), - location, LHSVal); + // In C++, assignment and compound assignment operators return an + // lvalue. + if (B->isLValue()) + state = state->BindExpr(B, location); + else + state = state->BindExpr(B, Result); + + evalStore(Tmp3, B, LHS, *I4, state, location, LHSVal); } } } |

