diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-22 00:43:59 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-22 00:43:59 +0000 |
commit | 7a62a9f53cec1f9ba1b9c79b4373fd11b44d7732 (patch) | |
tree | 4c4037044c7d2cd6256a6a3d828ab34e41706831 /array.c | |
parent | 5a41ffced289753ea0832eee1af0a616db4f5edf (diff) |
* array.c (rb_ary_initialize): should call rb_ary_modify() first.
[ruby-core:11562]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -272,6 +272,7 @@ rb_ary_initialize(argc, argv, ary) long len; VALUE size, val; + rb_ary_modify(ary); if (rb_scan_args(argc, argv, "02", &size, &val) == 0) { RARRAY(ary)->len = 0; if (rb_block_given_p()) { @@ -295,7 +296,6 @@ rb_ary_initialize(argc, argv, ary) if (len > 0 && len * (long)sizeof(VALUE) <= len) { rb_raise(rb_eArgError, "array size too big"); } - rb_ary_modify(ary); if (len > RARRAY(ary)->aux.capa) { REALLOC_N(RARRAY(ary)->ptr, VALUE, len); RARRAY(ary)->aux.capa = len; |