summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 07:10:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 07:10:43 +0000
commit336722930a44b39a0f8c81a654290882201374af (patch)
tree7eeb69e4a9530ceee87bbb03374caef6cf9a1e97 /array.c
parent0ba42821dd51693bf0968c3cc44489c3bed317b4 (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@12671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 91c298d..0ead081 100644
--- a/array.c
+++ b/array.c
@@ -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;