diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-01 09:09:44 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-01 09:09:44 +0000 |
commit | 7ce351db56fbce162a3b650518ce05b5c61ebf36 (patch) | |
tree | b8e666185681f67251775ca0ef80be4790669b4d /lib/Checker/GRCXXExprEngine.cpp | |
parent | 81bc7d07b701042371a5723b6f394cd2482ed7be (diff) |
Now initializer of C++ record type is visited as block-level expr.
Let the destination of AggExprVisitor be an explicit MemRegion.
Reenable the test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRCXXExprEngine.cpp')
-rw-r--r-- | lib/Checker/GRCXXExprEngine.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Checker/GRCXXExprEngine.cpp b/lib/Checker/GRCXXExprEngine.cpp index c6be6b681d..890387632f 100644 --- a/lib/Checker/GRCXXExprEngine.cpp +++ b/lib/Checker/GRCXXExprEngine.cpp @@ -91,9 +91,14 @@ void GRExprEngine::CreateCXXTemporaryObject(const Expr *Ex, ExplodedNode *Pred, } } -void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, SVal Dest, +void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, + const MemRegion *Dest, ExplodedNode *Pred, ExplodedNodeSet &Dst) { + if (!Dest) + Dest = ValMgr.getRegionManager().getCXXObjectRegion(E, + Pred->getLocationContext()); + if (E->isElidable()) { VisitAggExpr(E->getArg(0), Dest, Pred, Dst); return; @@ -124,7 +129,7 @@ void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, SVal Dest, const GRState *state = GetState(*NI); // Setup 'this' region, so that the ctor is evaluated on the object pointed // by 'Dest'. - state = state->bindLoc(loc::MemRegionVal(ThisR), Dest); + state = state->bindLoc(loc::MemRegionVal(ThisR), loc::MemRegionVal(Dest)); ExplodedNode *N = Builder->generateNode(Loc, state, Pred); if (N) Dst.Add(N); |