ruby-changes:64224
From: Takashi <ko1@a...>
Date: Thu, 17 Dec 2020 12:44:11 +0900 (JST)
Subject: [ruby-changes:64224] d07183ec85 (master): Do not access jit_unit if NULL
https://git.ruby-lang.org/ruby.git/commit/?id=d07183ec85 From d07183ec85dc20c7c034170bd8964c79c34a47d7 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Wed, 16 Dec 2020 19:43:17 -0800 Subject: Do not access jit_unit if NULL diff --git a/mjit.c b/mjit.c index 6528417..564d10d 100644 --- a/mjit.c +++ b/mjit.c @@ -350,6 +350,10 @@ mjit_recompile(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/mjit.c#L350 verbose(1, "JIT recompile: %s@%s:%d", RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(rb_iseq_path(iseq)), FIX2INT(iseq->body->location.first_lineno)); + iseq->body->jit_func = (mjit_func_t)NOT_ADDED_JIT_ISEQ_FUNC; + + if (iseq->body->jit_unit == NULL) // mjit_free_iseq is already called + return; // Lazily move active_units to stale_units to avoid race conditions around active_units with compaction CRITICAL_SECTION_START(3, "in rb_mjit_recompile_iseq"); @@ -357,7 +361,6 @@ mjit_recompile(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/mjit.c#L361 pending_stale_p = true; CRITICAL_SECTION_FINISH(3, "in rb_mjit_recompile_iseq"); - iseq->body->jit_func = (mjit_func_t)NOT_ADDED_JIT_ISEQ_FUNC; mjit_add_iseq_to_process(iseq, &iseq->body->jit_unit->compile_info); if (UNLIKELY(mjit_opts.wait)) { mjit_wait(iseq->body); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/