]> granicus.if.org Git - clang/commitdiff
RegionStore::RemoveDeadBindings needs to check all the symbols of the super region...
authorTed Kremenek <kremenek@apple.com>
Wed, 4 Mar 2009 00:11:38 +0000 (00:11 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 4 Mar 2009 00:11:38 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65981 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index f3d1f0a44fe49bdf0c96c3a9393843753929595d..7bae5e4487bf76c2198b1599583186db7040575a 100644 (file)
@@ -850,6 +850,26 @@ const GRState* RegionStoreManager::setExtent(const GRState* St,
 
 
 static void UpdateLiveSymbols(SVal X, SymbolReaper& SymReaper) {
+  if (loc::MemRegionVal *XR = dyn_cast<loc::MemRegionVal>(&X)) {
+    const MemRegion *R = XR->getRegion();
+    
+    while (R) {
+      if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(R)) {
+        SymReaper.markLive(SR->getSymbol());
+        return;
+      }
+      
+      if (const SubRegion *SR = dyn_cast<SubRegion>(R)) {
+        R = SR->getSuperRegion();
+        continue;
+      }
+      
+      break;
+    }
+    
+    return;
+  }
+  
   for (SVal::symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end();SI!=SE;++SI)
     SymReaper.markLive(*SI);
 }