]> granicus.if.org Git - clang/commitdiff
Improve zero value generation.
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 15 Nov 2008 05:18:50 +0000 (05:18 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 15 Nov 2008 05:18:50 +0000 (05:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59356 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index b09c49ec09350616a7bca2cb2c3cacd4618def1f..f1c57b33bdf183f92572e8d489388955fbdc121f 100644 (file)
@@ -232,8 +232,7 @@ SVal RegionStoreManager::ArrayToPointer(SVal Array) {
   const MemRegion* ArrayR = cast<loc::MemRegionVal>(&Array)->getRegion();
   BasicValueFactory& BasicVals = StateMgr.getBasicVals();
 
-  // FIXME: Find a better way to get bit width.
-  nonloc::ConcreteInt Idx(BasicVals.getValue(0, 32, false));
+  nonloc::ConcreteInt Idx(BasicVals.getZeroWithPtrWidth(false));
   ElementRegion* ER = MRMgr.getElementRegion(Idx, ArrayR);
   
   return loc::MemRegionVal(ER);