[cfe-commits] r71428 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon May 11 05:49:11 PDT 2009


Author: zhongxingxu
Date: Mon May 11 07:48:56 2009
New Revision: 71428

URL: http://llvm.org/viewvc/llvm-project?rev=71428&view=rev
Log:
Fix a bug that leads to infinite loop. Set the correct element type to
ElementRegion.

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=71428&r1=71427&r2=71428&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon May 11 07:48:56 2009
@@ -827,13 +827,11 @@
 
   llvm::ImmutableList<SVal> ArrayVal = getBasicVals().getEmptySValList();
   llvm::APSInt Size(CAT->getSize(), false);
-  llvm::APSInt i = getBasicVals().getValue(0, Size.getBitWidth(), 
-					   Size.isUnsigned());
+  llvm::APSInt i = getBasicVals().getZeroWithPtrWidth(false);
 
   for (; i < Size; ++i) {
     SVal Idx = NonLoc::MakeVal(getBasicVals(), i);
-    ElementRegion* ER = MRMgr.getElementRegion(R->getValueType(getContext()),
-                                               Idx, R);
+    ElementRegion* ER = MRMgr.getElementRegion(CAT->getElementType(), Idx, R);
     QualType ETy = ER->getElementType();
     SVal ElementVal = Retrieve(St, loc::MemRegionVal(ER), ETy);
     ArrayVal = getBasicVals().consVals(ElementVal, ArrayVal);





More information about the cfe-commits mailing list