ruby-changes:68922
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:16:36 +0900 (JST)
Subject: [ruby-changes:68922] 0a3ee8b2e3 (master): Avoid looping on invokesuper on module included multiple times
https://git.ruby-lang.org/ruby.git/commit/?id=0a3ee8b2e3 From 0a3ee8b2e314ee0950dbdb39e9dd0da58f63f16f Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Wed, 9 Jun 2021 19:04:22 -0700 Subject: Avoid looping on invokesuper on module included multiple times --- yjit_codegen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yjit_codegen.c b/yjit_codegen.c index 4e593f1322..afb1d00918 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -2953,6 +2953,13 @@ gen_invokesuper(jitstate_t *jit, ctx_t *ctx) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L2953 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); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/