diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-03 23:34:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-03 23:34:49 +0000 |
commit | 6e7ad958683f34bf6c014c88fef723e5a2d741be (patch) | |
tree | d9a3addec2c194094cb027f2daa97815a2862048 /lib/VMCore/ConstantFold.cpp | |
parent | b405bbe6648d24b0cb5b03dc43c3997ac4f50a9b (diff) |
Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index a869467245..701a195f7f 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -122,7 +122,9 @@ static Constant *FoldBitCast(LLVMContext &Context, } if (ElTy == DPTy->getElementType()) - return ConstantExpr::getGetElementPtr(V, &IdxList[0], IdxList.size()); + // This GEP is inbounds because all indices are zero. + return ConstantExpr::getInBoundsGetElementPtr(V, &IdxList[0], + IdxList.size()); } // Handle casts from one vector constant to another. We know that the src |