From 633fef6dec9f078d7c02b737a76f3aad0ba5ccc8 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 22 Nov 2018 07:53:07 +0000 Subject: Enable refinements to public_send. [Feature #15326] [Fix GH-2019] From: manga_osyo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index c0d7062947..47191a0aab 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -290,8 +290,16 @@ rb_call0(rb_execution_context_t *ec, VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope, VALUE self) { - const rb_callable_method_entry_t *me = rb_search_method_entry(recv, mid); - enum method_missing_reason call_status = rb_method_call_status(ec, me, scope, self); + const rb_callable_method_entry_t *me; + enum method_missing_reason call_status; + + if (scope == CALL_PUBLIC) { + me = rb_callable_method_entry_with_refinements(CLASS_OF(recv), mid, NULL); + } + else { + me = rb_search_method_entry(recv, mid); + } + call_status = rb_method_call_status(ec, me, scope, self); if (call_status != MISSING_NONE) { return method_missing(recv, mid, argc, argv, call_status); -- cgit v1.2.3