mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use proc_binding rather than rb_funcall
FIX
This commit is contained in:
parent
ee7cc6ac35
commit
fef52122b0
Notes:
git
2020-10-07 07:42:18 +09:00
1 changed files with 2 additions and 1 deletions
3
proc.c
3
proc.c
|
@ -48,6 +48,7 @@ VALUE rb_cProc;
|
|||
static rb_block_call_func bmcall;
|
||||
static int method_arity(VALUE);
|
||||
static int method_min_max_arity(VALUE, int *max);
|
||||
static VALUE proc_binding(VALUE self);
|
||||
|
||||
#define attached id__attached__
|
||||
|
||||
|
@ -2743,7 +2744,7 @@ VALUE
|
|||
rb_callable_receiver(VALUE callable)
|
||||
{
|
||||
if (rb_obj_is_proc(callable)) {
|
||||
VALUE binding = rb_funcall(callable, rb_intern("binding"), 0);
|
||||
VALUE binding = proc_binding(callable);
|
||||
return rb_funcall(binding, rb_intern("receiver"), 0);
|
||||
}
|
||||
else if (rb_obj_is_method(callable)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue