]> granicus.if.org Git - clang/commitdiff
Tweak GRState::unbindLoc to use makeWithStore, and make sure it's only called for...
authorJordy Rose <jediknil@belkadan.com>
Thu, 5 Aug 2010 03:33:56 +0000 (03:33 +0000)
committerJordy Rose <jediknil@belkadan.com>
Thu, 5 Aug 2010 03:33:56 +0000 (03:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110310 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRState.cpp

index 69470bbbb28003d3f65b5a03b8cdf81a1bcdd513..82563eddcac028b17959f127bed0e40417985ce3 100644 (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 {