fix a bug in the 1 index GEP handling code
authorChris Lattner <sabre@nondot.org>
Tue, 3 May 2005 16:44:45 +0000 (16:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 May 2005 16:44:45 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21670 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instructions.cpp

index 8404e0bad8eafbeb4a167681e02847f3c3455751..5c88c5428ddb15169e95491df7a43af3f0bca735 100644 (file)
@@ -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();
 }
 
 //===----------------------------------------------------------------------===//