summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-26 09:10:42 -0700
committerJeremy Evans <code@jeremyevans.net>2019-09-26 15:30:51 -0700
commit37f9213f8957e0c6dffee7d8803890907f97bdbb (patch)
tree3f864d0c39f3360d62b8a7c90bbeb1c92823c4eb /proc.c
parentdd2068ac8d4016f43c1f3cc1aa81decb504db5b6 (diff)
Fix keyword argument separation issues in Enumerator::Generator#each
This requires adding rb_proc_call_kw to pass the keyword flag.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2491
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index f03e470151..7c82cc63c8 100644
--- a/proc.c
+++ b/proc.c
@@ -935,6 +935,24 @@ check_argc(long argc)
#endif
VALUE
+rb_proc_call_kw(VALUE self, VALUE args, int kw_splat)
+{
+ VALUE vret;
+ rb_proc_t *proc;
+ VALUE v;
+ int argc = check_argc(RARRAY_LEN(args));
+ const VALUE *argv = RARRAY_CONST_PTR(args);
+ GetProcPtr(self, proc);
+ v = rb_adjust_argv_kw_splat(&argc, &argv, &kw_splat);
+ vret = rb_vm_invoke_proc(GET_EC(), proc, argc, argv,
+ kw_splat, VM_BLOCK_HANDLER_NONE);
+ rb_free_tmp_buffer(&v);
+ RB_GC_GUARD(self);
+ RB_GC_GUARD(args);
+ return vret;
+}
+
+VALUE
rb_proc_call(VALUE self, VALUE args)
{
VALUE vret;