Fix casts in RegionStore to not always assume that bindings are only to SubRegions. Fixes assertion failure

reported in PR 7572.

llvm-svn: 107738
This commit is contained in:
Ted Kremenek 2010-07-06 23:53:29 +00:00
parent 43adffd1d4
commit da534381f8
1 changed files with 4 additions and 4 deletions

View File

@ -615,8 +615,8 @@ void InvalidateRegionsWorker::VisitBinding(SVal V) {
RegionBindings B = RegionStoreManager::GetRegionBindings(LCS->getStore());
for (RegionBindings::iterator RI = B.begin(), RE = B.end(); RI != RE; ++RI){
const MemRegion *baseR = RI.getKey().getRegion();
if (cast<SubRegion>(baseR)->isSubRegionOf(LazyR))
const SubRegion *baseR = dyn_cast<SubRegion>(RI.getKey().getRegion());
if (baseR && baseR->isSubRegionOf(LazyR))
VisitBinding(RI.getData());
}
@ -1750,8 +1750,8 @@ void RemoveDeadBindingsWorker::VisitBinding(SVal V) {
const MemRegion *LazyR = LCS->getRegion();
RegionBindings B = RegionStoreManager::GetRegionBindings(LCS->getStore());
for (RegionBindings::iterator RI = B.begin(), RE = B.end(); RI != RE; ++RI){
const MemRegion *baseR = RI.getKey().getRegion();
if (cast<SubRegion>(baseR)->isSubRegionOf(LazyR))
const SubRegion *baseR = dyn_cast<SubRegion>(RI.getKey().getRegion());
if (baseR && baseR->isSubRegionOf(LazyR))
VisitBinding(RI.getData());
}
return;