diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-06-09 16:30:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 16:30:55 -0700 |
commit | ad0eccf840f692694e63ec72c8496dc106e603ed (patch) | |
tree | f65375353ae6f7ed357a04356f6b6e3abe9240da /proc.c | |
parent | 9491bd89dace4fa26f1e5333d0ebbca14749eb3e (diff) |
Work around infinite loop when overriding method visibility in prepended module (#3201)
For ZSUPER methods with no defined class for the method entry, start the next lookup at the superclass of the origin class of the method owner, instead of the superclass of the method owner.
Fixes [Bug #16942]
Notes
Notes:
Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1572,12 +1572,12 @@ mnew_internal(const rb_method_entry_t *me, VALUE klass, VALUE iclass, } if (me->def->type == VM_METHOD_TYPE_ZSUPER) { if (me->defined_class) { - VALUE klass = RCLASS_SUPER(RCLASS_ORIGIN(me->defined_class)); + VALUE klass = RCLASS_SUPER(RCLASS_ORIGIN(me->defined_class)); id = me->def->original_id; me = (rb_method_entry_t *)rb_callable_method_entry_with_refinements(klass, id, &iclass); } else { - VALUE klass = RCLASS_SUPER(me->owner); + VALUE klass = RCLASS_SUPER(RCLASS_ORIGIN(me->owner)); id = me->def->original_id; me = rb_method_entry_without_refinements(klass, id, &iclass); } |