diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-05-04 07:04:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-05-04 07:04:36 +0000 |
commit | 20bd746306ecdc61125800d53ff7e07321704064 (patch) | |
tree | b837c831f7d873aa342d48c68b300231a36a0ea5 /lib/Analysis/Store.cpp | |
parent | b84e8a670ad1d00c0a34295c42ac700cdde04815 (diff) |
BasicStore: 'ElementRegion' is the new 'TypedViewRegion'.
StoreManager: Handle casts from one element region to another.
Update test cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Store.cpp')
-rw-r--r-- | lib/Analysis/Store.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Analysis/Store.cpp b/lib/Analysis/Store.cpp index e9b8f6a27f..76437d2c86 100644 --- a/lib/Analysis/Store.cpp +++ b/lib/Analysis/Store.cpp @@ -68,7 +68,12 @@ StoreManager::CastRegion(const GRState* state, const MemRegion* R, // FIXME: We should have a standard query function to get the size // of the array index. SVal Idx = ValMgr.makeZeroVal(ValMgr.getContext().VoidPtrTy); - ElementRegion* ER = MRMgr.getElementRegion(Pointee, Idx, TR); + + // If the super region is an element region, strip it away. + // FIXME: Is this the right thing to do in all cases? + const TypedRegion *Base = isa<ElementRegion>(TR) ? + cast<TypedRegion>(TR->getSuperRegion()) : TR; + ElementRegion* ER = MRMgr.getElementRegion(Pointee, Idx, Base); return CastResult(state, ER); } } |