diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-02-25 13:37:52 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-02-25 13:37:52 +0900 |
commit | 84d1a99a3fc76b4bcd5fc382e5b30a466b124493 (patch) | |
tree | 661bbc796e6dc2d9cc538d09864fbed35cac57d9 /mjit_worker.c | |
parent | 670b7be6c5fb9c3438fb6e36070401f25806f725 (diff) |
should be initialize jit_unit->cc_entries.
GC can invoke just after allocation of jit_unit->cc_entries so
it should be zero-cleared.
Diffstat (limited to 'mjit_worker.c')
-rw-r--r-- | mjit_worker.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mjit_worker.c b/mjit_worker.c index d074b7b957..f55942e0db 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1141,7 +1141,7 @@ mjit_copy_cache_from_main_thread(const rb_iseq_t *iseq, union iseq_inline_storag if (iseq->body->jit_unit == NULL) rb_fatal("malloc failed"); if (iseq->body->ci_size > 0) { iseq->body->jit_unit->cc_entries = - (const struct rb_callcache **)malloc(sizeof(const struct rb_callcache *) * iseq->body->ci_size); + (const struct rb_callcache **)calloc(iseq->body->ci_size, sizeof(const struct rb_callcache *)); if (iseq->body->jit_unit->cc_entries == NULL) rb_fatal("malloc failed"); } } |