summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-03 23:06:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-04 02:12:57 +0900
commit184f78314e98cab63e7503cead4a4e99bd132a08 (patch)
tree97ba75dd05fc557a30ec400627980b9385f66ab2 /vm_insnhelper.c
parent8340c773e54feb399c9fab322e3ff6dd578ac04d (diff)
Properly resolve refinements in defined? on private call [Bug #16932]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3180
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index f910c036f1..f8936b33c5 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3651,12 +3651,9 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_
}
case DEFINED_FUNC:
klass = CLASS_OF(v);
- if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
+ if (rb_ec_obj_respond_to(ec, v, SYM2ID(obj), TRUE)) {
expr_type = DEFINED_METHOD;
}
- else {
- expr_type = check_respond_to_missing(obj, v);
- }
break;
case DEFINED_METHOD:{
VALUE klass = CLASS_OF(v);