diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-01-13 16:49:05 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-01-13 18:11:46 +0900 |
commit | 85b5d4c8bf4cdcba4f1af65f2bc0c8ac716cb795 (patch) | |
tree | b7a5aa2ebe8cc22ddf94a6edca03469d9f309e9e /vm_method.c | |
parent | 9441f3f97087a4325ee80911859d37da41fa5050 (diff) | |
download | ruby-85b5d4c8bf4cdcba4f1af65f2bc0c8ac716cb795.tar.gz |
Revert "[Bug #11213] let defined?(super) call respond_to_missing?"
This reverts commit fac2498e0299f13dffe4f09a7dd7657fb49bf643 for
now, due to [Bug #17509], the breakage in the case `super` is
called in `respond_to?`.
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vm_method.c b/vm_method.c index a933729faa..61b27da513 100644 --- a/vm_method.c +++ b/vm_method.c @@ -2435,8 +2435,9 @@ basic_obj_respond_to_missing(rb_execution_context_t *ec, VALUE klass, VALUE obj, } static inline int -basic_obj_respond_to(rb_execution_context_t *ec, VALUE klass, VALUE obj, ID id, int pub) +basic_obj_respond_to(rb_execution_context_t *ec, VALUE obj, ID id, int pub) { + VALUE klass = CLASS_OF(obj); VALUE ret; switch (method_boundp(klass, id, pub|BOUND_RESPONDS)) { @@ -2506,14 +2507,15 @@ int rb_obj_respond_to(VALUE obj, ID id, int priv) { rb_execution_context_t *ec = GET_EC(); - return rb_ec_obj_respond_to(ec, CLASS_OF(obj), obj, id, priv); + return rb_ec_obj_respond_to(ec, obj, id, priv); } int -rb_ec_obj_respond_to(rb_execution_context_t *ec, VALUE klass, VALUE obj, ID id, int priv) +rb_ec_obj_respond_to(rb_execution_context_t *ec, VALUE obj, ID id, int priv) { + VALUE klass = CLASS_OF(obj); int ret = vm_respond_to(ec, klass, obj, id, priv); - if (ret == -1) ret = basic_obj_respond_to(ec, klass, obj, id, !priv); + if (ret == -1) ret = basic_obj_respond_to(ec, obj, id, !priv); return ret; } @@ -2558,7 +2560,7 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj) if (ret == Qundef) ret = Qfalse; return ret; } - if (basic_obj_respond_to(ec, CLASS_OF(obj), obj, id, !RTEST(priv))) + if (basic_obj_respond_to(ec, obj, id, !RTEST(priv))) return Qtrue; return Qfalse; } |