From dd23e4658b8587adf8d6fed96b574a979b169e46 Mon Sep 17 00:00:00 2001 From: Noah Gibbs Date: Tue, 27 Jul 2021 16:54:45 +0100 Subject: [PATCH] If codeblock is NULL because YJIT is disabled, YJIT.runtime_stats should return Qnil --- yjit_iface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yjit_iface.c b/yjit_iface.c index ff8c52c4b9..90b4ed9555 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -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();