summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2021-06-09 19:04:22 -0700
committerAlan Wu <[email protected]>2021-10-20 18:19:36 -0400
commit0a3ee8b2e314ee0950dbdb39e9dd0da58f63f16f (patch)
tree77e9811910b71b69cdd9b43860706b50f38d1e86
parent3fedf8329d0b0916be1cf6ec27ca76e3b2233d03 (diff)
Avoid looping on invokesuper on module included multiple times
-rw-r--r--yjit_codegen.c7
1 files changed, 7 insertions, 0 deletions
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)
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);