summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-11 05:37:21 +0000
committerChris Lattner <sabre@nondot.org>2011-02-11 05:37:21 +0000
commit33a8f3385b2b6145fe640b390fcb2579cb4fe671 (patch)
tree43cd3ca661daa522eb918f5c0e97b9f9ef7152eb /lib
parent1f78d51be69964b38c5fc76ceb2147b737d09857 (diff)
downloadllvm-33a8f3385b2b6145fe640b390fcb2579cb4fe671.tar.gz
llvm-33a8f3385b2b6145fe640b390fcb2579cb4fe671.tar.bz2
llvm-33a8f3385b2b6145fe640b390fcb2579cb4fe671.tar.xz
make ConstantExpr::replaceUsesOfWithOnConstant preserve the inbounds
flag. Noticed by Jin Gu Kang! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Constants.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 3a5a8b0663..42c60769f5 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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;