diff options
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -851,13 +851,18 @@ refine_sym_proc_call(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)) ID mid; const rb_callable_method_entry_t *me; rb_execution_context_t *ec; + const VALUE symbol = RARRAY_AREF(callback_arg, 0); + const VALUE refinements = RARRAY_AREF(callback_arg, 1); if (argc-- < 1) { rb_raise(rb_eArgError, "no receiver given"); } obj = *argv++; - mid = SYM2ID(callback_arg); - me = rb_callable_method_entry_with_refinements(CLASS_OF(obj), mid, NULL); + + mid = SYM2ID(symbol); + me = rb_callable_method_entry(CLASS_OF(obj), mid); + me = rb_resolve_refined_method_callable(refinements, me); + ec = GET_EC(); if (!NIL_P(blockarg)) { vm_passed_block_handler_set(ec, blockarg); @@ -888,7 +893,8 @@ 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 */ - func = rb_func_proc_new(refine_sym_proc_call, block_code); + VALUE callback_arg = rb_ary_new_from_args(2, block_code, ref); + func = rb_func_proc_new(refine_sym_proc_call, callback_arg); rb_hash_aset(ref, block_code, func); } block_code = func; |