]> granicus.if.org Git - clang/commitdiff
set region default value if there are not enough init values for array and struct.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 24 Dec 2008 07:29:24 +0000 (07:29 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 24 Dec 2008 07:29:24 +0000 (07:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61418 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index 78bb65487150fd588e51ab005e60d0c2a9d279dd..020fb53c7c66c3a77962f76703442a355f13a34b 100644 (file)
@@ -765,8 +765,8 @@ const GRState* RegionStoreManager::BindArray(const GRState* St,
 
   // When we are binding the whole array, it always has default value 0.
   GRStateRef state(St, StateMgr);
-  //  St = state.set<RegionDefaultValue>(R, NonLoc::MakeVal(getBasicVals(), 0, 
-  //                                                        false));
+  St = state.set<RegionDefaultValue>(R, NonLoc::MakeVal(getBasicVals(), 0, 
+                                                        false));
 
   Store store = St->getStore();
 
@@ -841,9 +841,9 @@ RegionStoreManager::BindStruct(const GRState* St, const TypedRegion* R, SVal V){
     // There may be fewer values than fields only when we are initializing a
     // struct decl. In this case, mark the region as having default value.
     if (VI == VE) {
-      // GRStateRef state(St, StateMgr);
-    //St = state.set<RegionDefaultValue>(R, NonLoc::MakeVal(getBasicVals(), 0, 
-      //                                                   false));
+      GRStateRef state(St, StateMgr);
+      St = state.set<RegionDefaultValue>(R, NonLoc::MakeVal(getBasicVals(), 0, 
+                                                            false));
       break;
     }