summaryrefslogtreecommitdiffstats
path: root/clang/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
commit67c710e2c882943fca09469b4568e59015008cef (patch)
treeaf1b448941174f2af35480a8ddb236048a938a4f /clang/lib/Analysis/RegionStore.cpp
parent817b7692fb29516e7da96a3d0623b2e1957b5ccb (diff)
downloadbcm5719-llvm-67c710e2c882943fca09469b4568e59015008cef.tar.gz
bcm5719-llvm-67c710e2c882943fca09469b4568e59015008cef.zip
RegionStore::RemoveDeadBindings needs to check all the symbols of the super region of a scanned region as well.
llvm-svn: 65981
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index f3d1f0a44fe..7bae5e4487b 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud