diff options
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 |