summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 15:06:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 15:06:20 +0000
commiteff784082b8b8874c7c2c540174252675dc02ddf (patch)
tree96f9235a1c5360d195eb283a75ad6df1235bd20f
parent188b67397315283a86388531f87bac4384a5af00 (diff)
Freeze and hide callback arguments holder
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--vm_args.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vm_args.c b/vm_args.c
index af192da979..bea38078ec 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -893,7 +893,10 @@ vm_caller_setup_arg_block(const rb_execution_context_t *ec, rb_control_frame_t *
VALUE func = rb_hash_lookup(ref, block_code);
if (NIL_P(func)) {
/* TODO: limit cached funcs */
- VALUE callback_arg = rb_ary_new_from_args(2, block_code, ref);
+ VALUE callback_arg = rb_ary_tmp_new(2);
+ RARRAY_ASET(callback_arg, 0, block_code);
+ RARRAY_ASET(callback_arg, 1, ref);
+ OBJ_FREEZE_RAW(callback_arg);
func = rb_func_proc_new(refine_sym_proc_call, callback_arg);
rb_hash_aset(ref, block_code, func);
}