1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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@shopify.com>
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
This commit is contained in:
Aaron Patterson 2021-11-22 12:32:47 -08:00 committed by Aaron Patterson
parent 157095b3a4
commit 4079f0da51
Notes: git 2021-12-02 05:46:21 +09:00

View file

@ -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