diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-29 01:36:51 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-29 01:36:51 +0000 |
commit | ce6644bc1e921833f9b3c10cf7d4a0b78e8d5dc9 (patch) | |
tree | 91a2010cdd5a2acc261bdbabca64b836c7b11c4c /lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 20aa40342bd74895128860c081aa84cd85bfa68d (diff) |
Revert "[analyzer] Create a temporary region for rvalue structs when accessing fields"
This reverts commit 6f61df3e7256413dcb99afb9673f4206e3c4992c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 06216f83ea..8e2c159ca7 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1505,17 +1505,17 @@ void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred, ProgramStateRef state = Pred->getState(); const LocationContext *LCtx = Pred->getLocationContext(); SVal baseExprVal = state->getSVal(baseExpr, Pred->getLocationContext()); - - // If we're accessing a field of an rvalue, we need to treat it like a - // temporary object. - if (isa<NonLoc>(baseExprVal)) { - const MemRegion *R = - svalBuilder.getRegionManager().getCXXTempObjectRegion(baseExpr, LCtx); - SVal L = loc::MemRegionVal(R); - state = state->bindLoc(L, baseExprVal); - baseExprVal = L; + if (isa<nonloc::LazyCompoundVal>(baseExprVal) || + isa<nonloc::CompoundVal>(baseExprVal) || + // FIXME: This can originate by conjuring a symbol for an unknown + // temporary struct object, see test/Analysis/fields.c: + // (p = getit()).x + isa<nonloc::SymbolVal>(baseExprVal)) { + Bldr.generateNode(M, Pred, state->BindExpr(M, LCtx, UnknownVal())); + return; } + // For all other cases, compute an lvalue. SVal L = state->getLValue(field, baseExprVal); if (M->isGLValue()) { ExplodedNodeSet Tmp; |