diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-07-28 23:07:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-07-28 23:07:36 +0000 |
commit | eea72a925f294225391ecec876a342771c09b635 (patch) | |
tree | c4429dfd08ff5c38b7662ca266609aa4b80b4db8 /lib/StaticAnalyzer/Core/CXXExprEngine.cpp | |
parent | 86c67d8802a9e0887c31c850188991465ac3c1bd (diff) |
[analyzer] fix handling of MaterializeTemporaryExpr by binding the result value to
the proper expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/CXXExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/CXXExprEngine.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp index 137aa2ab64..eecf1146ad 100644 --- a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp @@ -103,23 +103,24 @@ const CXXThisRegion *ExprEngine::getCXXThisRegion(const CXXMethodDecl *decl, getCXXThisRegion(decl->getThisType(getContext()), frameCtx); } -void ExprEngine::CreateCXXTemporaryObject(const Expr *Ex, ExplodedNode *Pred, - ExplodedNodeSet &Dst) { +void ExprEngine::CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME, + ExplodedNode *Pred, + ExplodedNodeSet &Dst) { ExplodedNodeSet Tmp; - Visit(Ex, Pred, Tmp); + Visit(ME->GetTemporaryExpr(), Pred, Tmp); for (ExplodedNodeSet::iterator I = Tmp.begin(), E = Tmp.end(); I != E; ++I) { const GRState *state = GetState(*I); // Bind the temporary object to the value of the expression. Then bind // the expression to the location of the object. - SVal V = state->getSVal(Ex); + SVal V = state->getSVal(ME->GetTemporaryExpr()); const MemRegion *R = - svalBuilder.getRegionManager().getCXXTempObjectRegion(Ex, + svalBuilder.getRegionManager().getCXXTempObjectRegion(ME, Pred->getLocationContext()); state = state->bindLoc(loc::MemRegionVal(R), V); - MakeNode(Dst, Ex, Pred, state->BindExpr(Ex, loc::MemRegionVal(R))); + MakeNode(Dst, ME, Pred, state->BindExpr(ME, loc::MemRegionVal(R))); } } |