BasicStore: 'ElementRegion' is the new 'TypedViewRegion'.
StoreManager: Handle casts from one element region to another.
Update test cases.
llvm-svn: 70836
diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp
index e9b8f6a..76437d2 100644
--- a/clang/lib/Analysis/Store.cpp
+++ b/clang/lib/Analysis/Store.cpp
@@ -68,7 +68,12 @@
// 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);
}
}