]> granicus.if.org Git - clang/commitdiff
Adjust retrieve handler priority. If a field is of array type, it should be
authorZhongxing Xu <xuzhongxing@gmail.com>
Sun, 28 Jun 2009 14:16:39 +0000 (14:16 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sun, 28 Jun 2009 14:16:39 +0000 (14:16 +0000)
handled by RetrieveArray().

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

lib/Analysis/RegionStore.cpp

index 65864196c7d6d201088c0ea5f6aa61c721a7d76b..493f14d499ae7c261fdaa138206a608193cd1f9d 100644 (file)
@@ -822,12 +822,6 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
   const TypedRegion *R = cast<TypedRegion>(MR);
   assert(R && "bad region");
 
-  if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
-    return RetrieveField(state, FR);
-
-  if (const ElementRegion* ER = dyn_cast<ElementRegion>(R))
-    return RetrieveElement(state, ER);
-
   // FIXME: We should eventually handle funny addressing.  e.g.:
   //
   //   int x = ...;
@@ -848,6 +842,12 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
   // FIXME: handle Vector types.
   if (RTy->isVectorType())
       return UnknownVal();
+
+  if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
+    return RetrieveField(state, FR);
+
+  if (const ElementRegion* ER = dyn_cast<ElementRegion>(R))
+    return RetrieveElement(state, ER);
   
   RegionBindingsTy B = GetRegionBindings(state->getStore());
   RegionBindingsTy::data_type* V = B.lookup(R);