For now, return UnknownVal() in RegionStore::getElementsSize() for AnonTypedRegions.  It wasn't really doing the right thing and was crashing on rdar-6442306-1.m.  This fix causes all path-sensitive test cases to pass with RegionStore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62816 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index ec801d4..48c11f3 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -420,6 +420,12 @@
   }
 
   if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {
+#if 0
+    // FIXME: This logic doesn't really work, as we can have all sorts of
+    // weird cases.  For example, this crashes on test case 'rdar-6442306-1.m'.
+    // The weird cases come in when arbitrary casting comes into play, violating
+    // any type-safe programming.
+    
     GRStateRef state(St, StateMgr);
 
     // Get the size of the super region in bytes.
@@ -450,6 +456,10 @@
       (SSize * getBasicVals().getValue(8, SSize.getBitWidth(), false)) / ESize;
 
     return NonLoc::MakeVal(getBasicVals(), S);
+#else
+    ATR = ATR;
+    return UnknownVal();
+#endif
   }
 
   if (const FieldRegion* FR = dyn_cast<FieldRegion>(R)) {