[analyzer] Fix a c++11 crash: xvalues can be locations (VisitMemberExpr)

llvm-svn: 157082
This commit is contained in:
Anna Zaks 2012-05-18 22:47:43 +00:00
parent b343660914
commit 457ace7611
2 changed files with 13 additions and 1 deletions

View File

@ -1537,7 +1537,7 @@ void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
// For all other cases, compute an lvalue.
SVal L = state->getLValue(field, baseExprVal);
if (M->isLValue())
if (M->isGLValue())
Bldr.generateNode(M, Pred, state->BindExpr(M, LCtx, L), false, 0,
ProgramPoint::PostLValueKind);
else {

View File

@ -0,0 +1,12 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s
// radar://11485149, PR12871
class PlotPoint {
bool valid;
};
PlotPoint limitedFit () {
PlotPoint fit0;
fit0 = limitedFit ();
return fit0;
}