8000 Check that cb / ocb exist before marking executable · ruby/ruby@efae920 · GitHub
[go: up one dir, main page]

Skip to content

Commit efae920

Browse files
tenderlovemaximecbkddnewton
committed
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>
1 parent 4440c71 commit efae920

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

yjit_iface.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,15 @@ rb_yjit_iseq_update_references(const struct rb_iseq_constant_body *body)
962962
//block->code_page = rb_gc_location(block->code_page);
963963
}
964964
}
965-
cb_mark_all_executable(cb);
966-
cb_mark_all_executable(ocb);
965+
966+
/* If YJIT isn't initialized, then cb or ocb could be NULL. */
967+
if (cb) {
968+
cb_mark_all_executable(cb);
969+
}
970+
971+
if (ocb) {
972+
cb_mark_all_executable(ocb);
973+
}
967974
}
968975

969976
// Free the yjit resources associated with an iseq

0 commit comments

Comments
 (0)
0