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
This commit is contained in:
Ted Kremenek 2009-06-30 22:31:23 +00:00
parent 58d8190417
commit aff66a8a19
1 changed files with 3 additions and 3 deletions

View File

@ -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<ElementRegion>(TR) ?
cast<TypedRegion>(TR->getSuperRegion()) : TR;
const MemRegion *Base = isa<ElementRegion>(TR) ? TR->getSuperRegion()
: TR;
ElementRegion* ER = MRMgr.getElementRegion(Pointee, Idx, Base,
StateMgr.getContext());
StateMgr.getContext());
return CastResult(state, ER);
}
}