summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-01-12 12:09:32 -0800
committerGitHub <noreply@github.com>2023-01-12 15:09:32 -0500
commitda7e5c7b776e8ebbbef97c15305fbad5d032242b (patch)
treefbb3d461e4fe24e507c2099ac83c04d5074f461f /yjit.rb
parent8d3ff663899211c9c0ca2a8cf7d994e7acd3f83e (diff)
downloadruby-da7e5c7b776e8ebbbef97c15305fbad5d032242b.tar.gz
YJIT: Do not refer to an undefined constant (#7112)
Diffstat (limited to 'yjit.rb')
-rw-r--r--yjit.rb9
1 files changed, 3 insertions, 6 deletions
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