diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/Environment.cpp | 8 | ||||
-rw-r--r-- | lib/Analysis/GRState.cpp | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/Analysis/Environment.cpp b/lib/Analysis/Environment.cpp index 98cd7d8168..0b8ee66f15 100644 --- a/lib/Analysis/Environment.cpp +++ b/lib/Analysis/Environment.cpp @@ -74,12 +74,12 @@ Environment EnvironmentManager::BindExpr(Environment Env, const Stmt *S, if (V.isUnknown()) { if (Invalidate) - return Environment(F.Remove(Env.ExprBindings, S)); + return Environment(F.Remove(Env.ExprBindings, S), Env.ACtx); else return Env; } - return Environment(F.Add(Env.ExprBindings, S, V)); + return Environment(F.Add(Env.ExprBindings, S, V), Env.ACtx); } namespace { @@ -105,12 +105,12 @@ EnvironmentManager::RemoveDeadBindings(Environment Env, const Stmt *S, const GRState *ST, llvm::SmallVectorImpl<const MemRegion*> &DRoots) { - CFG &C = *ST->getAnalysisContext().getCFG(); + CFG &C = *Env.getAnalysisContext().getCFG(); // We construct a new Environment object entirely, as this is cheaper than // individually removing all the subexpression bindings (which will greatly // outnumber block-level expression bindings). - Environment NewEnv = getInitialEnvironment(); + Environment NewEnv = getInitialEnvironment(&Env.getAnalysisContext()); // Iterate over the block-expr bindings. for (Environment::iterator I = Env.begin(), E = Env.end(); diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp index 7bef351006..a2cfdeb96c 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Analysis/GRState.cpp @@ -85,22 +85,20 @@ SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const { } -const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool Invalidate) const { - +const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool Invalidate) const{ Environment NewEnv = getStateManager().EnvMgr.BindExpr(Env, Ex, V, - Invalidate); - + Invalidate); if (NewEnv == Env) return this; - + GRState NewSt = *this; NewSt.Env = NewEnv; return getStateManager().getPersistentState(NewSt); } const GRState* GRStateManager::getInitialState(const LocationContext *InitLoc) { - GRState State(this, InitLoc->getAnalysisContext(), - EnvMgr.getInitialEnvironment(), + GRState State(this, + EnvMgr.getInitialEnvironment(InitLoc->getAnalysisContext()), StoreMgr->getInitialStore(InitLoc), GDMFactory.GetEmptyMap()); |