]> granicus.if.org Git - clang/commitdiff
Update old CastRegion logic to not assume that ElementRegion's super region is a
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Jun 2009 22:31:23 +0000 (22:31 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Jun 2009 22:31:23 +0000 (22:31 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74559 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Store.cpp

index 5aa756e14be375bed8cbc66c040c02a28239ad0d..cb099862f05514e80c2ef5506b4bb0f7e08a37e4 100644 (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);
       }
     }