From acb1bb161ad5ba4e36844de1f0b8aec3b7f0e1d7 Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Thu, 19 Dec 2013 20:35:54 +0100 Subject: [PATCH] Fix a problem with the new array bounds check code. --- gen/arrays.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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());