diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-05-11 12:48:56 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-05-11 12:48:56 +0000 |
| commit | bf938d316062cf0b884142d7c0d21209d081b719 (patch) | |
| tree | 173b9c5306f3d480dc3de779469c1935a0305fec /clang/lib/Analysis/RegionStore.cpp | |
| parent | aa9c0194619d84d9eb112f4287269c05068ad931 (diff) | |
| download | bcm5719-llvm-bf938d316062cf0b884142d7c0d21209d081b719.tar.gz bcm5719-llvm-bf938d316062cf0b884142d7c0d21209d081b719.zip | |
Fix a bug that leads to infinite loop. Set the correct element type to
ElementRegion.
llvm-svn: 71428
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index a66e63c8770..84c8195ecb1 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -827,13 +827,11 @@ SVal RegionStoreManager::RetrieveArray(const GRState* St, const TypedRegion* R){ 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); |

