forked from OSchip/llvm-project
To be consistent, make the index of the ElementRegion always signed.
llvm-svn: 60248
This commit is contained in:
parent
5661fead0b
commit
452273d9c6
|
@ -415,7 +415,11 @@ class ElementRegion : public TypedRegion {
|
|||
SVal Index;
|
||||
|
||||
ElementRegion(SVal Idx, const MemRegion* sReg)
|
||||
: TypedRegion(sReg, ElementRegionKind), Index(Idx) {}
|
||||
: TypedRegion(sReg, ElementRegionKind), Index(Idx) {
|
||||
// The index must be signed.
|
||||
if (nonloc::ConcreteInt* CI = dyn_cast<nonloc::ConcreteInt>(&Idx))
|
||||
assert(CI->getValue().isSigned());
|
||||
}
|
||||
|
||||
static void ProfileRegion(llvm::FoldingSetNodeID& ID, SVal Idx,
|
||||
const MemRegion* superRegion);
|
||||
|
|
|
@ -646,7 +646,7 @@ Store RegionStoreManager::InitializeArray(Store store, const TypedRegion* R,
|
|||
nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();
|
||||
|
||||
for (; i != Size; ++i) {
|
||||
nonloc::ConcreteInt Idx(getBasicVals().getValue(llvm::APSInt(i)));
|
||||
nonloc::ConcreteInt Idx(getBasicVals().getValue(llvm::APSInt(i, false)));
|
||||
|
||||
ElementRegion* ER = MRMgr.getElementRegion(Idx, R);
|
||||
|
||||
|
|
Loading…
Reference in New Issue