From da7e5c7b776e8ebbbef97c15305fbad5d032242b Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 12 Jan 2023 12:09:32 -0800 Subject: YJIT: Do not refer to an undefined constant (#7112) --- yjit.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'yjit.rb') diff --git a/yjit.rb b/yjit.rb index 988f20fa44..062784f564 100644 --- a/yjit.rb +++ b/yjit.rb @@ -195,14 +195,11 @@ module RubyVM::YJIT # Produce a list of instructions compiled by YJIT for an iseq def self.insns_compiled(iseq) + return nil unless self.enabled? + # If a method or proc is passed in, get its iseq iseq = RubyVM::InstructionSequence.of(iseq) - - if self.enabled? - Primitive.rb_yjit_insns_compiled(iseq) - else - Qnil - end + Primitive.rb_yjit_insns_compiled(iseq) end # Free and recompile all existing JIT code -- cgit v1.2.1