aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-05 01:46:20 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-05 01:46:20 +0000
commit0d630d220414b02fed6873555bb46795a682174b (patch)
tree0b4c987c389b68eaffc3d9994e779044e466f593 /lib/CodeGen
parentac8d27686db34181ad21a74d2a95a6c9f63a735e (diff)
downloadexternal_llvm-0d630d220414b02fed6873555bb46795a682174b.zip
external_llvm-0d630d220414b02fed6873555bb46795a682174b.tar.gz
external_llvm-0d630d220414b02fed6873555bb46795a682174b.tar.bz2
GEP subscript is interpreted as a signed value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index f4fe873..d8d862d 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1703,7 +1703,7 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
if (CI->getZExtValue() == 0) continue;
uint64_t Offs =
- TD->getTypeSize(Ty)*cast<ConstantInt>(CI)->getZExtValue();
+ TD->getTypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offs));
continue;
}