diff options
author | Aaron Patterson <[email protected]> | 2021-11-22 12:32:47 -0800 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2021-12-01 12:45:59 -0800 |
commit | 4079f0da51c1e226ce6e09597e32ab116d1c7812 (patch) | |
tree | 80749fb94b297285198b173d2d6171c132e87afe /yjit_iface.c | |
parent | 157095b3a44d8b0130a532a0b7be3f5ac197111c (diff) |
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 <[email protected]>
Co-Authored-By: Kevin Newton <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5032
Diffstat (limited to 'yjit_iface.c')
-rw-r--r-- | yjit_iface.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/yjit_iface.c b/yjit_iface.c index 39967a89a9..739d639ae6 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) //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 |