summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorChris Seaton <chris.seaton@shopify.com>2020-10-05 23:51:34 +0100
committerAaron Patterson <aaron.patterson@gmail.com>2020-10-06 15:41:47 -0700
commitfef52122b0c0dfabf947c3f016334b84a9eeb903 (patch)
treee7a6b32caf994198606baeb858d39be48abd26dc /proc.c
parentee7cc6ac35cfb056b3946b1dcd6d4d5a140ccacf (diff)
downloadruby-fef52122b0c0dfabf947c3f016334b84a9eeb903.tar.gz
Use proc_binding rather than rb_funcall
FIX
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index b6285b18c2..061c6c34a6 100644
--- a/proc.c
+++ b/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)) {