ruby-changes:70002
From: Aaron <ko1@a...>
Date: Thu, 2 Dec 2021 05:46:12 +0900 (JST)
Subject: [ruby-changes:70002] 4079f0da51 (master): Check that cb / ocb exist before marking executable
https://git.ruby-lang.org/ruby.git/commit/?id=4079f0da51 From 4079f0da51c1e226ce6e09597e32ab116d1c7812 Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Mon, 22 Nov 2021 12:32:47 -0800 Subject: Check that cb / ocb exist before marking executable If YJIT isn't enabled, or hasn't finished booting, cb / ocb could be null. This commit just checks to make sure they're available before marking as executable Co-Authored-By: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Co-Authored-By: Kevin Newton <kddnewton@g...> --- yjit_iface.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yjit_iface.c b/yjit_iface.c index 39967a89a95..739d639ae66 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -962,8 +962,15 @@ rb_yjit_iseq_update_references(const struct rb_iseq_constant_body *body) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L962 //block->code_page = rb_gc_location(block->code_page); } } - cb_mark_all_executable(cb); - cb_mark_all_executable(ocb); + + /* If YJIT isn't initialized, then cb or ocb could be NULL. */ + if (cb) { + cb_mark_all_executable(cb); + } + + if (ocb) { + cb_mark_all_executable(ocb); + } } // Free the yjit resources associated with an iseq -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/