From: Chris Lattner Date: Tue, 3 May 2005 16:44:45 +0000 (+0000) Subject: fix a bug in the 1 index GEP handling code X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f818cfe0969d74ca356f87947b651230fdad6ed0;p=oota-llvm.git fix a bug in the 1 index GEP handling code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21670 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 8404e0bad8e..5c88c5428dd 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -728,7 +728,7 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) { // Check the pointer index. if (!PTy->indexValid(Idx)) return 0; - return PTy; + return PTy->getElementType(); } //===----------------------------------------------------------------------===//