summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 0c740285be..2291001a2e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -694,6 +694,23 @@ rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv)
return rb_call(recv, mid, argc, argv, CALL_PUBLIC);
}
+VALUE
+rb_funcall_with_block(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE pass_procval)
+{
+ if (!NIL_P(pass_procval)) {
+ rb_thread_t *th = GET_THREAD();
+ rb_block_t *block = 0;
+
+ rb_proc_t *pass_proc;
+ GetProcPtr(pass_procval, pass_proc);
+ block = &pass_proc->block;
+
+ th->passed_block = block;
+ }
+
+ return rb_call(recv, mid, argc, argv, CALL_PUBLIC);
+}
+
static VALUE
send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
{