# HG changeset patch # User Christian Kamm # Date 1218659506 -7200 # Node ID 39dbe48d3fe29992df25e07efc3675e81146b17c # Parent a6c105aa00d5949fe8d09f8164bc06da094e4b65 Got rid of improper static array compile time index check. It had caused tango.core.Variant to fail to compile. diff -r a6c105aa00d5 -r 39dbe48d3fe2 gen/arrays.cpp --- a/gen/arrays.cpp Wed Aug 13 22:14:43 2008 +0200 +++ b/gen/arrays.cpp Wed Aug 13 22:31:46 2008 +0200 @@ -1035,23 +1035,8 @@ Type* arrty = arr->getType()->toBasetype(); assert((arrty->ty == Tsarray || arrty->ty == Tarray) && "Can only array bounds check for static or dynamic arrays"); - // static arrays can get static checks for static indices - - if(arr->getType()->ty == Tsarray) - { - TypeSArray* tsa = (TypeSArray*)arrty; - size_t tdim = tsa->dim->toInteger(); - - if(llvm::ConstantInt* cindex = llvm::dyn_cast(index->getRVal())) - if(cindex->uge(tdim + (isslice ? 1 : 0))) { - size_t cindexval = cindex->getValue().getZExtValue(); - if(!isslice) - error(loc, "index %u is larger or equal array size %u", cindexval, tdim); - else - error(loc, "slice upper bound %u is larger than array size %u", cindexval, tdim); - return; - } - } + // static arrays could get static checks for static indices + // but shouldn't since it might be generic code that's never executed // runtime check