summaryrefslogtreecommitdiffstats
path: root/clang/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
commit28041c29afccdc5b8c0021e179e6dab195929db1 (patch)
treed02a48dab84cf3df516eb95186f039c0ba4adeb8 /clang/lib/Checker/GRState.cpp
parentc88c74cb2f2b2b1106d309875b49a2f127b151ab (diff)
downloadbcm5719-llvm-28041c29afccdc5b8c0021e179e6dab195929db1.tar.gz
bcm5719-llvm-28041c29afccdc5b8c0021e179e6dab195929db1.zip
Tweak GRState::unbindLoc to use makeWithStore, and make sure it's only called for non-region locations.
llvm-svn: 110310
Diffstat (limited to 'clang/lib/Checker/GRState.cpp')
-rw-r--r--clang/lib/Checker/GRState.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Checker/GRState.cpp b/clang/lib/Checker/GRState.cpp
index 69470bbbb28..82563eddcac 100644
--- a/clang/lib/Checker/GRState.cpp
+++ b/clang/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 {
OpenPOWER on IntegriCloud