aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-09 07:35:13 +0000
committerChris Lattner <sabre@nondot.org>2007-12-09 07:35:13 +0000
commitf88380ba2cf472db6576a8534315449931e8cf50 (patch)
tree493a54675bf52362d2667cdb68cd076c937caa3f /lib/Analysis
parent8d1ea750601cd27f5d70cef1186864abcf57bdb1 (diff)
downloadexternal_llvm-f88380ba2cf472db6576a8534315449931e8cf50.zip
external_llvm-f88380ba2cf472db6576a8534315449931e8cf50.tar.gz
external_llvm-f88380ba2cf472db6576a8534315449931e8cf50.tar.bz2
Fix PR1782, patch by Wojtek Matyjewicz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 99d9499..557d521 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -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
}