aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-04 00:11:38 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-04 00:11:38 +0000
commit02c4d2d3835ccc744f2092885256ec5ee1498be3 (patch)
treef1dbc2bce8592cc80d9f2e31d7a1d08a9e19ffbd /lib/Analysis/RegionStore.cpp
parent3d1c9462e3bc084e4c9ff4eaa1140ed53a2f7614 (diff)
RegionStore::RemoveDeadBindings needs to check all the symbols of the super region of a scanned region as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index f3d1f0a44f..7bae5e4487 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -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);
}