diff options
author | Koichi Sasada <ko1@atdot.net> | 2023-07-31 12:26:27 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2023-07-31 14:04:31 +0900 |
commit | 36023d5cb751d62fca0c27901c07527b20170f4d (patch) | |
tree | e042a12b89f942eb5b4424d04c80a1795fa79a7f /gc.c | |
parent | 60ac719acc3e4eccab770ebdd959dffcb702f2f2 (diff) | |
download | ruby-36023d5cb751d62fca0c27901c07527b20170f4d.tar.gz |
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.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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: { |