summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-03-12 22:23:48 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2020-03-12 22:23:51 -0700
commit43e18c68f4d53767db7aae232ca46c2b400148cd (patch)
treeec9dde16e1a1c0a35cfd8a5d33b2b23fefb82b12 /mjit.c
parent8562bfd1501a69aa736ba4f699a77940b2cdd9b1 (diff)
downloadruby-43e18c68f4d53767db7aae232ca46c2b400148cd.tar.gz
Mark all cc_entries associated to compiled_iseq
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index 02a74a6152..b03d92cb77 100644
--- a/mjit.c
+++ b/mjit.c
@@ -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.