1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Mark all cc_entries associated to compiled_iseq

This commit is contained in:
Takashi Kokubun 2020-03-12 22:23:48 -07:00
parent 8562bfd150
commit 43e18c68f4
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

3
mjit.c
View file

@ -1021,7 +1021,8 @@ mjit_mark_cc_entries(const struct rb_iseq_constant_body *const body)
{
const struct rb_callcache **cc_entries;
if (body->jit_unit && (cc_entries = body->jit_unit->cc_entries) != NULL) {
for (unsigned int i = 0; i < body->ci_size; i++) {
// It must be `body->jit_unit->cc_entries_size` instead of `body->ci_size` to mark children's cc_entries
for (unsigned int i = 0; i < body->jit_unit->cc_entries_size; i++) {
const struct rb_callcache *cc = cc_entries[i];
if (cc != NULL) {
// Pin `cc` and `cc->cme` against GC.compact as their addresses may be written in JIT-ed code.