Fix a problem with negative indexes

llvm-svn: 5681
This commit is contained in:
Chris Lattner 2003-03-02 23:43:34 +00:00
parent 88126c0003
commit 96afad55b9
1 changed files with 3 additions and 3 deletions

View File

@ -301,11 +301,11 @@ BasicAliasAnalysis::CheckGEPInstructions(GetElementPtrInst *GEP1, unsigned G1S,
}
}
unsigned Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, Indices1);
unsigned Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, Indices2);
int Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, Indices1);
int Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, Indices2);
assert(Offset1 < Offset2 &&"There is at least one different constant here!");
if (Offset2-Offset1 >= SizeMax) {
if ((unsigned)(Offset2-Offset1) >= SizeMax) {
//std::cerr << "Determined that these two GEP's don't alias ["
// << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
return NoAlias;