diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-07-06 23:53:29 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-07-06 23:53:29 +0000 |
commit | 0ea0e8b4028db1e3c196025354dcddb8765f73bc (patch) | |
tree | 002b81e9c1ec9b82161c02083fbd19584463a505 /lib/Checker/RegionStore.cpp | |
parent | dd5faf05dfe0163bdde939937d4fb0270086178a (diff) |
Fix casts in RegionStore to not always assume that bindings are only to SubRegions. Fixes assertion failure
reported in PR 7572.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/RegionStore.cpp')
-rw-r--r-- | lib/Checker/RegionStore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index 7164b832c2..74a7fee048 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -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; |