aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/GRState.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-08-05 03:33:56 +0000
committerJordy Rose <jediknil@belkadan.com>2010-08-05 03:33:56 +0000
commita9c76216c9d055b7161fdbe78f531e5f7fcd4f1e (patch)
treed212c0f36594440494cf94f6daf573cd014b6934 /lib/Checker/GRState.cpp
parent58f8b202d1f81bdbba9e1fad4d455afc8c124793 (diff)
Tweak GRState::unbindLoc to use makeWithStore, and make sure it's only called for non-region locations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRState.cpp')
-rw-r--r--lib/Checker/GRState.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp
index 69470bbbb2..82563eddca 100644
--- a/lib/Checker/GRState.cpp
+++ b/lib/Checker/GRState.cpp
@@ -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 {