From 0d630d220414b02fed6873555bb46795a682174b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 5 Jan 2007 01:46:20 +0000 Subject: [PATCH] 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 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f4fe873f9fb..d8d862d7098 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(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD->getTypeSize(Ty)*cast(CI)->getZExtValue(); + TD->getTypeSize(Ty)*cast(CI)->getSExtValue(); N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offs)); continue; }