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 | a6446681932568411d78d26c5fc6e3d8358be357 (patch) | |
tree | 7d3b0fa7104a9074743eadfae41c2a1503bbc5b3 /clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp | |
parent | caed7c6954cfad10fc884bb3631b5f4aa7fe221c (diff) | |
download | bcm5719-llvm-a6446681932568411d78d26c5fc6e3d8358be357.tar.gz bcm5719-llvm-a6446681932568411d78d26c5fc6e3d8358be357.zip |
[analyzer] fix handling of MaterializeTemporaryExpr by binding the result value to
the proper expression.
llvm-svn: 136412
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp index 137aa2ab64f..eecf1146adc 100644 --- a/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp +++ b/clang/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))); } } |