diff options
| author | Anna Zaks <ganna@apple.com> | 2012-05-18 22:47:43 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2012-05-18 22:47:43 +0000 |
| commit | 457ace7611d82047265f718cf1ea3f67c5d7b70f (patch) | |
| tree | 924c82848e43329b35b03a2f6759252f3472140a | |
| parent | b34366091413a8021e21bd7ae1656bf74d1ef54c (diff) | |
| download | bcm5719-llvm-457ace7611d82047265f718cf1ea3f67c5d7b70f.tar.gz bcm5719-llvm-457ace7611d82047265f718cf1ea3f67c5d7b70f.zip | |
[analyzer] Fix a c++11 crash: xvalues can be locations (VisitMemberExpr)
llvm-svn: 157082
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Analysis/cxx11-crashes.cpp | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 97a8cefd13a..dcc79a543f3 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -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 { diff --git a/clang/test/Analysis/cxx11-crashes.cpp b/clang/test/Analysis/cxx11-crashes.cpp new file mode 100644 index 00000000000..9164850555b --- /dev/null +++ b/clang/test/Analysis/cxx11-crashes.cpp @@ -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; +} |

