diff options
author | Noah Gibbs <noah.gibbs@shopify.com> | 2021-07-27 16:54:45 +0100 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:38 -0400 |
commit | dd23e4658b8587adf8d6fed96b574a979b169e46 (patch) | |
tree | 946629587ab21efa5609cd3704d29e1663621463 /yjit_iface.c | |
parent | 50029fb127c38b345dc781ea8f67bfc372cc5390 (diff) |
If codeblock is NULL because YJIT is disabled, YJIT.runtime_stats should return Qnil
Diffstat (limited to 'yjit_iface.c')
-rw-r--r-- | yjit_iface.c | 5 |
1 files changed, 5 insertions, 0 deletions
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(); |