diff --git a/gen/arrays.cpp b/gen/arrays.cpp index ac203a20..944e4c25 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -1137,10 +1137,9 @@ void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, DValue* lowerBoun // Do not emit bounds check code if the index is statically known to be // within bounds. - if (arrty->ty == Tsarray && isaConstantInt(index->getRVal())) { + if (arrty->ty == Tsarray && isaConstantInt(index->getRVal()) && !lowerBound) { assert(!arr->isSlice()); assert(!arr->isNull()); - assert(!lowerBound); TypeSArray *sarray = static_cast(arrty); llvm::ConstantInt *constIndex = static_cast(index->getRVal());