diff options
author | Chris Lattner <sabre@nondot.org> | 2003-03-02 23:43:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-03-02 23:43:34 +0000 |
commit | 96afad55b9283c71a6caca12d0f1ab66e281505f (patch) | |
tree | ef91c42d0edf5918747c4b4a021400a204832b37 /llvm/lib | |
parent | 88126c0003099c4aab6c733d2dd8a7a6b51fe490 (diff) | |
download | bcm5719-llvm-96afad55b9283c71a6caca12d0f1ab66e281505f.tar.gz bcm5719-llvm-96afad55b9283c71a6caca12d0f1ab66e281505f.zip |
Fix a problem with negative indexes
llvm-svn: 5681
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 2242d4f5b39..d9456f56e5e 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -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; |