From aff66a8a19d9430aa2459dfcf731ea00565d433a Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 30 Jun 2009 22:31:23 +0000 Subject: [PATCH] Update old CastRegion logic to not assume that ElementRegion's super region is a TypedRegion. While we plan on removing this code at some point, it serves as a good reference implementation for use with BasicStore until we are sure the new CastRegion logic (in RegionStore.cpp) is correct. llvm-svn: 74559 --- clang/lib/Analysis/Store.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp index 5aa756e14be3..cb099862f055 100644 --- a/clang/lib/Analysis/Store.cpp +++ b/clang/lib/Analysis/Store.cpp @@ -88,10 +88,10 @@ StoreManager::CastRegion(const GRState* state, const MemRegion* R, // 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(TR) ? - cast(TR->getSuperRegion()) : TR; + const MemRegion *Base = isa(TR) ? TR->getSuperRegion() + : TR; ElementRegion* ER = MRMgr.getElementRegion(Pointee, Idx, Base, - StateMgr.getContext()); + StateMgr.getContext()); return CastResult(state, ER); } }