diff options
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -776,7 +776,12 @@ vm_caller_setup_arg_block(const rb_thread_t *th, rb_control_frame_t *reg_cfp, proc = *(--reg_cfp->sp); - if (proc != Qnil) { + if (SYMBOL_P(proc) && rb_method_basic_definition_p(rb_cSymbol, idTo_proc)) { + calling->blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(reg_cfp); + calling->blockptr->iseq = (rb_iseq_t *)IFUNC_NEW(rb_sym_proc_call, SYM2ID(proc), 0); + calling->blockptr->proc = 0; + } + else if (!NIL_P(proc)) { if (!rb_obj_is_proc(proc)) { VALUE b; b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc"); |