Revision: 5257 http://trac.macosforge.org/projects/ruby/changeset/5257 Author: watson1978@gmail.com Date: 2011-03-06 03:55:02 -0800 (Sun, 06 Mar 2011) Log Message: ----------- 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 }}} Modified Paths: -------------- MacRuby/trunk/array.c Modified: MacRuby/trunk/array.c =================================================================== --- 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"); }
participants (1)
-
source_changes@macosforge.org