summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2011-01-10 03:54:19 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2011-01-10 03:54:19 +0000
commit5609e213374fbaccd17ee8504266cfae805e7573 (patch)
tree68ab7476cb26decf628c044e826b0a7e73d679aa /clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
parent1bf55f2af74a8401ab2b868db61423a82d4bf71c (diff)
downloadbcm5719-llvm-5609e213374fbaccd17ee8504266cfae805e7573.tar.gz
bcm5719-llvm-5609e213374fbaccd17ee8504266cfae805e7573.zip
In C++, assignment and compound assignment operators return an lvalue.
llvm-svn: 123158
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp10
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);
}
}
}
OpenPOWER on IntegriCloud