Array#fill(start, length) will raise a ArgumentError when was passed huge length.
Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
ary = [ "a", "b", "c" ]
assert_raise(ArgumentError){ ary.fill("z", 0, 2**60) }
puts :ok
}}}
--- MacRuby/trunk/array.c 2011-03-06 11:08:26 UTC (rev 5256)
+++ MacRuby/trunk/array.c 2011-03-06 11:55:02 UTC (rev 5257)
@@ -2292,7 +2292,7 @@
return ary;
}
end = beg + len;
- if (end < 0) {
+ if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) {
rb_raise(rb_eArgError, "argument too big");
}