From e5160a9c60e4a8b1e53b94c3e696968d9f61f6c9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 5 Jun 2024 11:26:25 -0700 Subject: [PATCH] Mark the class on orphan call caches "super" CC's are "orphans", meaning there is no class CC table that points at them. Since they are orphans, we should mark the class reference so that if the cache happens to be used, the class will still be alive --- imemo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/imemo.c b/imemo.c index 23a9a7531f..088185b195 100644 --- a/imemo.c +++ b/imemo.c @@ -316,6 +316,7 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating) else { if (vm_cc_super_p(cc) || vm_cc_refinement_p(cc)) { rb_gc_mark_movable((VALUE)cc->cme_); + rb_gc_mark_movable((VALUE)cc->klass); } }