summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2023-07-31 12:26:27 +0900
committerKoichi Sasada <ko1@atdot.net>2023-07-31 14:04:31 +0900
commit36023d5cb751d62fca0c27901c07527b20170f4d (patch)
treee042a12b89f942eb5b4424d04c80a1795fa79a7f /gc.c
parent60ac719acc3e4eccab770ebdd959dffcb702f2f2 (diff)
mark `cc->cme_` if it is for `super`
`vm_search_super_method()` makes orphan CCs (they are not connected from ccs) and `cc->cme_` can be collected before without marking.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8145
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 54582bd81a..916e08eb03 100644
--- a/gc.c
+++ b/gc.c
@@ -7030,7 +7030,15 @@ gc_mark_imemo(rb_objspace_t *objspace, VALUE obj)
* - On the multi-Ractors, cme will be collected with global GC
* so that it is safe if GC is not interleaving while accessing
* cc and cme.
+ * - However, cc_type_super is not chained from cc so the cc->cme
+ * should be marked.
*/
+ {
+ const struct rb_callcache *cc = (const struct rb_callcache *)obj;
+ if (vm_cc_super_p(cc)) {
+ gc_mark(objspace, (VALUE)cc->cme_);
+ }
+ }
return;
case imemo_constcache:
{