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

If codeblock is NULL because YJIT is disabled, YJIT.runtime_stats should return Qnil

This commit is contained in:
Noah Gibbs 2021-07-27 16:54:45 +01:00 committed by Alan Wu
parent 50029fb127
commit dd23e4658b

View file

@ -702,6 +702,11 @@ comments_for(rb_execution_context_t *ec, VALUE self, VALUE start_address, VALUE
static VALUE
get_yjit_stats(rb_execution_context_t *ec, VALUE self)
{
// Return Qnil if YJIT isn't enabled
if (cb == NULL) {
return Qnil;
}
VALUE hash = rb_hash_new();
RB_VM_LOCK_ENTER();