From 84d1a99a3fc76b4bcd5fc382e5b30a466b124493 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Tue, 25 Feb 2020 13:37:52 +0900 Subject: should be initialize jit_unit->cc_entries. GC can invoke just after allocation of jit_unit->cc_entries so it should be zero-cleared. --- mjit_worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mjit_worker.c') 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"); } } -- cgit v1.2.3