diff --git a/ChangeLog b/ChangeLog index 5b34b58a22..410f45b9da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Jun 22 16:14:30 2009 Nobuyoshi Nakada + + * compile.c (iseq_set_arguments, iseq_compile_each): internal + arrays must be hidden. [ruby-dev:38613] + + * vm.c (Init_top_self): ditto. + Mon Jun 22 14:41:47 2009 Nobuyoshi Nakada * ruby.c (process_options), enc/prelude.rb: encdb and transdb are diff --git a/compile.c b/compile.c index e8075f89a6..710e00d612 100644 --- a/compile.c +++ b/compile.c @@ -1089,7 +1089,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args) if (node_opt) { NODE *node = node_opt; LABEL *label; - VALUE labels = rb_ary_new(); + VALUE labels = rb_ary_tmp_new(1); int i = 0, j; while (node) { @@ -1113,6 +1113,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args) for (j = 0; j < i; j++) { iseq->arg_opt_table[j] &= ~1; } + rb_ary_clear(labels); } else { iseq->arg_opts = 0; @@ -3013,7 +3014,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) DECL_ANCHOR(head); DECL_ANCHOR(body_seq); DECL_ANCHOR(cond_seq); - VALUE special_literals = rb_ary_new(); + VALUE special_literals = rb_ary_tmp_new(1); INIT_ANCHOR(head); INIT_ANCHOR(body_seq); diff --git a/vm.c b/vm.c index acd624d6b2..983b11d5b5 100644 --- a/vm.c +++ b/vm.c @@ -2066,7 +2066,7 @@ Init_top_self(void) rb_define_singleton_method(rb_vm_top_self(), "to_s", main_to_s, 0); /* initialize mark object array */ - vm->mark_object_ary = rb_ary_new(); + vm->mark_object_ary = rb_ary_tmp_new(1); } VALUE *