diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-22 07:53:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-22 07:53:07 +0000 |
commit | 633fef6dec9f078d7c02b737a76f3aad0ba5ccc8 (patch) | |
tree | 066fd47de5067080401333949c4871111a12ad9b /vm_eval.c | |
parent | 8a15e0800615a849e93ed3192290bc8315b6c200 (diff) |
Enable refinements to public_send.
[Feature #15326] [Fix GH-2019]
From: manga_osyo <manga.osyo@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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); |