1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Avoid looping on invokesuper on module included multiple times

This commit is contained in:
John Hawthorn 2021-06-09 19:04:22 -07:00 committed by Alan Wu
parent 3fedf8329d
commit 0a3ee8b2e3

View file

@ -2953,6 +2953,13 @@ gen_invokesuper(jitstate_t *jit, ctx_t *ctx)
return YJIT_CANT_COMPILE;
}
// Because we're assuming only one current_defined_class for a given
// receiver class we need to check that the superclass doesn't also
// re-include the same module.
if (rb_class_search_ancestor(comptime_superclass, current_defined_class)) {
return YJIT_CANT_COMPILE;
}
// Do method lookup
const rb_callable_method_entry_t *cme = rb_callable_method_entry(comptime_superclass, mid);