diff options
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 0e48864645..007bcf5208 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1515,30 +1515,22 @@ void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred, return; } + // FIXME: Should we insert some assumption logic in here to determine + // if "Base" is a valid piece of memory? Before we put this assumption + // later when using FieldOffset lvals (which we no longer have). + // For all other cases, compute an lvalue. SVal L = state->getLValue(field, baseExprVal); if (M->isGLValue()) { - ExplodedNodeSet Tmp; - Bldr.takeNodes(Pred); - evalLocation(Tmp, M, M, Pred, state, baseExprVal, - /*Tag=*/0, /*isLoad=*/true); - Bldr.addNodes(Tmp); - - const MemRegion *ReferenceRegion = 0; if (field->getType()->isReferenceType()) { - ReferenceRegion = L.getAsRegion(); - if (!ReferenceRegion) + if (const MemRegion *R = L.getAsRegion()) + L = state->getSVal(R); + else L = UnknownVal(); } - for (ExplodedNodeSet::iterator I = Tmp.begin(), E = Tmp.end(); I != E; ++I){ - state = (*I)->getState(); - if (ReferenceRegion) - L = state->getSVal(ReferenceRegion); - - Bldr.generateNode(M, (*I), state->BindExpr(M, LCtx, L), 0, - ProgramPoint::PostLValueKind); - } + Bldr.generateNode(M, Pred, state->BindExpr(M, LCtx, L), 0, + ProgramPoint::PostLValueKind); } else { Bldr.takeNodes(Pred); evalLoad(Dst, M, M, Pred, state, L); |