forked from OSchip/llvm-project
Fix a bug that leads to infinite loop. Set the correct element type to
ElementRegion. llvm-svn: 71428
This commit is contained in:
parent
aa9c019461
commit
bf938d3160
|
@ -827,13 +827,11 @@ SVal RegionStoreManager::RetrieveArray(const GRState* St, const TypedRegion* R){
|
||||||
|
|
||||||
llvm::ImmutableList<SVal> ArrayVal = getBasicVals().getEmptySValList();
|
llvm::ImmutableList<SVal> ArrayVal = getBasicVals().getEmptySValList();
|
||||||
llvm::APSInt Size(CAT->getSize(), false);
|
llvm::APSInt Size(CAT->getSize(), false);
|
||||||
llvm::APSInt i = getBasicVals().getValue(0, Size.getBitWidth(),
|
llvm::APSInt i = getBasicVals().getZeroWithPtrWidth(false);
|
||||||
Size.isUnsigned());
|
|
||||||
|
|
||||||
for (; i < Size; ++i) {
|
for (; i < Size; ++i) {
|
||||||
SVal Idx = NonLoc::MakeVal(getBasicVals(), i);
|
SVal Idx = NonLoc::MakeVal(getBasicVals(), i);
|
||||||
ElementRegion* ER = MRMgr.getElementRegion(R->getValueType(getContext()),
|
ElementRegion* ER = MRMgr.getElementRegion(CAT->getElementType(), Idx, R);
|
||||||
Idx, R);
|
|
||||||
QualType ETy = ER->getElementType();
|
QualType ETy = ER->getElementType();
|
||||||
SVal ElementVal = Retrieve(St, loc::MemRegionVal(ER), ETy);
|
SVal ElementVal = Retrieve(St, loc::MemRegionVal(ER), ETy);
|
||||||
ArrayVal = getBasicVals().consVals(ElementVal, ArrayVal);
|
ArrayVal = getBasicVals().consVals(ElementVal, ArrayVal);
|
||||||
|
|
Loading…
Reference in New Issue