From e07e9f8491d9ab8b22d2bdf6a8aeba834dac7eef Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 9 Mar 2023 22:31:50 -0800 Subject: [PATCH] RJIT: Do nothing on jit_cont_free if cont is NULL. --- cont.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cont.c b/cont.c index d77bef39527661..4173e5a6b94f80 100644 --- a/cont.c +++ b/cont.c @@ -1255,6 +1255,8 @@ jit_cont_new(rb_execution_context_t *ec) static void jit_cont_free(struct rb_jit_cont *cont) { + if (!cont) return; + rb_native_mutex_lock(&jit_cont_lock); if (cont == first_jit_cont) { first_jit_cont = cont->next;