Author: zhongxingxu
Date: Tue Jun 23 19:56:31 2009
New Revision: 74043

URL: http://llvm.org/viewvc/llvm-project?rev=74043&view=rev
Log:
RegionStore: revert to the default value approach for array initialization.

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=74043&r1=74042&r2=74043&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Tue Jun 23 19:56:31 2009
@@ -1127,15 +1127,12 @@
       state = Bind(state, ValMgr.makeLoc(ER), *VI);
   }
 
-  // If the init list is shorter than the array length, bind the rest elements
-  // to 0.
-  if (ElementTy->isIntegerType()) {
-    while (i < Size) {
-      SVal Idx = ValMgr.makeIntVal(i);
-      ElementRegion* ER = MRMgr.getElementRegion(ElementTy, 
Idx,R,getContext());
+  // If the init list is shorter than the array length, set the array default
+  // value.
+  if (i < Size) {
+    if (ElementTy->isIntegerType()) {
       SVal V = ValMgr.makeZeroVal(ElementTy);
-      state = Bind(state, ValMgr.makeLoc(ER), V);
-      ++i;
+      state = setDefaultValue(state, R, V);
     }
   }
 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to