summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 12:24:52 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 12:24:52 +0000
commit09cb662a8ab70b7a46310f50d295b0af4a526e5d (patch)
treea48ecbefb1b4f07f7f4a7d2254a7fabb49c49429 /array.c
parent7c1aaff1eb18c836c620096f0fc05e2f8fc629a3 (diff)
* array.c (rb_ary_fill): (compatibility) do not raise
ArgumentError on negative length. This behaviour shall change in a future release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/array.c b/array.c
index f4ed6e67d8..9eda004130 100644
--- a/array.c
+++ b/array.c
@@ -2416,6 +2416,9 @@ rb_ary_fill(argc, argv, ary)
break;
}
rb_ary_modify(ary);
+ if (len < 0) {
+ return ary;
+ }
if (len > ARY_MAX_SIZE - beg) {
rb_raise(rb_eArgError, "argument too big");
}