Skip to content

Commit 84fe9db

Browse files
authored
Merge pull request ruby#141 from Shopify/yjit_stats_no_segfault_with_yjit_disabled
Don't add code size YJIT-stats if codeblock pointer is NULL.
2 parents 1119934 + c7ffc4a commit 84fe9db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

yjit_iface.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ comments_for(rb_execution_context_t *ec, VALUE self, VALUE start_address, VALUE
702702
static VALUE
703703
get_yjit_stats(rb_execution_context_t *ec, VALUE self)
704704
{
705+
// Return Qnil if YJIT isn't enabled
706+
if (cb == NULL) {
707+
return Qnil;
708+
}
709+
705710
VALUE hash = rb_hash_new();
706711

707712
RB_VM_LOCK_ENTER();

0 commit comments

Comments
 (0)