From c656cbb8c20d1ea38bdb5d1ac39dbcd0405a98dc Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 4 Sep 2007 15:46:09 +0000 Subject: Update GEP constructors to use an iterator interface to fix GLIBCXX_DEBUG issues. llvm-svn: 41697 --- llvm/lib/VMCore/Constants.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/VMCore/Constants.cpp') diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 8e3d946ec47..f7cbe82e72a 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -1799,7 +1799,7 @@ Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C, Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, Value* const *Idxs, unsigned NumIdx) { - assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, NumIdx, true) && + assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true) && "GEP indices invalid!"); if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx)) @@ -1821,7 +1821,7 @@ Constant *ConstantExpr::getGetElementPtr(Constant *C, Value* const *Idxs, unsigned NumIdx) { // Get the result type of the getelementptr! const Type *Ty = - GetElementPtrInst::getIndexedType(C->getType(), Idxs, NumIdx, true); + GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true); assert(Ty && "GEP indices invalid!"); return getGetElementPtrTy(PointerType::get(Ty), C, Idxs, NumIdx); } -- cgit v1.2.3