summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
-rw-r--r--llvm/lib/VMCore/Constants.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index 3a5a8b06635..42c60769f5e 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -2054,7 +2054,8 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
Indices.push_back(Val);
}
Replacement = ConstantExpr::getGetElementPtr(Pointer,
- &Indices[0], Indices.size());
+ &Indices[0], Indices.size(),
+ cast<GEPOperator>(this)->isInBounds());
} else if (getOpcode() == Instruction::ExtractValue) {
Constant *Agg = getOperand(0);
if (Agg == From) Agg = To;
OpenPOWER on IntegriCloud