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 | e4ca02da1b6f41343cbf7595c0c63c73b66ab705 (patch) | |
tree | 749a8a5096f2331dbc88b19e86e17cc1d0660fbc /llvm/lib/VMCore/ConstantFold.cpp | |
parent | 19e1eec248e6b713fd213754761c6afbe664dc22 (diff) | |
download | bcm5719-llvm-e4ca02da1b6f41343cbf7595c0c63c73b66ab705.tar.gz bcm5719-llvm-e4ca02da1b6f41343cbf7595c0c63c73b66ab705.zip |
Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.
llvm-svn: 80969
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index a8694672456..701a195f7fd 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/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 |