mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Fix PR1782, patch by Wojtek Matyjewicz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -730,8 +730,8 @@ BasicAliasAnalysis::CheckGEPInstructions(
|
||||
if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) {
|
||||
if (Op1C->getZExtValue() >= AT->getNumElements())
|
||||
return MayAlias; // Be conservative with out-of-range accesses
|
||||
} else if (const VectorType *PT = dyn_cast<VectorType>(BasePtr1Ty)) {
|
||||
if (Op1C->getZExtValue() >= PT->getNumElements())
|
||||
} else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr1Ty)) {
|
||||
if (Op1C->getZExtValue() >= VT->getNumElements())
|
||||
return MayAlias; // Be conservative with out-of-range accesses
|
||||
}
|
||||
|
||||
@ -756,10 +756,10 @@ BasicAliasAnalysis::CheckGEPInstructions(
|
||||
if (Op2) {
|
||||
if (const ConstantInt *Op2C = dyn_cast<ConstantInt>(Op2)) {
|
||||
// If this is an array index, make sure the array element is in range.
|
||||
if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) {
|
||||
if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr2Ty)) {
|
||||
if (Op2C->getZExtValue() >= AT->getNumElements())
|
||||
return MayAlias; // Be conservative with out-of-range accesses
|
||||
} else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr1Ty)) {
|
||||
} else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr2Ty)) {
|
||||
if (Op2C->getZExtValue() >= VT->getNumElements())
|
||||
return MayAlias; // Be conservative with out-of-range accesses
|
||||
}
|
||||
|
Reference in New Issue
Block a user