Tweak GRState::unbindLoc to use makeWithStore, and make sure it's only called for non-region locations.

llvm-svn: 110310
This commit is contained in:
Jordy Rose 2010-08-05 03:33:56 +00:00
parent c88c74cb2f
commit 28041c29af
1 changed files with 3 additions and 3 deletions

View File

@ -69,15 +69,15 @@ const GRState *GRStateManager::MarshalState(const GRState *state,
}
const GRState *GRState::unbindLoc(Loc LV) const {
assert(!isa<loc::MemRegionVal>(LV) && "Use InvalidateRegion instead.");
Store OldStore = getStore();
Store NewStore = getStateManager().StoreMgr->Remove(OldStore, LV);
if (NewStore == OldStore)
return this;
GRState NewSt = *this;
NewSt.St = NewStore;
return getStateManager().getPersistentState(NewSt);
return makeWithStore(NewStore);
}
SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {