diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 429f225670b..8a690feed1e 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -245,9 +245,7 @@ Constant *llvm::ConstantFoldInstOperands(const Instruction* I, if (Constant *C = SymbolicallyEvaluateGEP(Ops, NumOps, I->getType(), TD)) return C; - return ConstantExpr::getGetElementPtr(Ops[0], - std::vector(Ops+1, - Ops+NumOps)); + return ConstantExpr::getGetElementPtr(Ops[0], Ops+1, NumOps-1); } }