From: Ted Kremenek Date: Wed, 4 Mar 2009 00:11:38 +0000 (+0000) Subject: RegionStore::RemoveDeadBindings needs to check all the symbols of the super region... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02c4d2d3835ccc744f2092885256ec5ee1498be3;p=clang 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 --- 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(&X)) { + const MemRegion *R = XR->getRegion(); + + while (R) { + if (const SymbolicRegion *SR = dyn_cast(R)) { + SymReaper.markLive(SR->getSymbol()); + return; + } + + if (const SubRegion *SR = dyn_cast(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); }