summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-03-16 23:32:55 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-03-16 23:38:26 +0900
commitd514ba8e17106c6d159c3902ac5456d6269731f8 (patch)
tree4a0be3434f9aeeea98f7f94f6d830a0d19a52377 /proc.c
parent304538e6ff64b8daadde5456988fb9f82c6a4849 (diff)
`Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index 909a25994b..9a4aaf4918 100644
--- a/proc.c
+++ b/proc.c
@@ -667,7 +667,7 @@ bind_location(VALUE bindval)
}
static VALUE
-cfunc_proc_new(VALUE klass, VALUE ifunc, int8_t is_lambda)
+cfunc_proc_new(VALUE klass, VALUE ifunc)
{
rb_proc_t *proc;
cfunc_proc_t *sproc;
@@ -685,7 +685,7 @@ cfunc_proc_new(VALUE klass, VALUE ifunc, int8_t is_lambda)
/* self? */
RB_OBJ_WRITE(procval, &proc->block.as.captured.code.ifunc, ifunc);
- proc->is_lambda = is_lambda;
+ proc->is_lambda = TRUE;
return procval;
}
@@ -736,14 +736,14 @@ MJIT_FUNC_EXPORTED VALUE
rb_func_proc_new(rb_block_call_func_t func, VALUE val)
{
struct vm_ifunc *ifunc = rb_vm_ifunc_proc_new(func, (void *)val);
- return cfunc_proc_new(rb_cProc, (VALUE)ifunc, 0);
+ return cfunc_proc_new(rb_cProc, (VALUE)ifunc);
}
MJIT_FUNC_EXPORTED VALUE
rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc)
{
struct vm_ifunc *ifunc = rb_vm_ifunc_new(func, (void *)val, min_argc, max_argc);
- return cfunc_proc_new(rb_cProc, (VALUE)ifunc, 1);
+ return cfunc_proc_new(rb_cProc, (VALUE)ifunc);
}
static const char proc_without_block[] = "tried to create Proc object without a block";