summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-03-05 22:09:57 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2023-03-05 23:28:59 -0800
commit22d944c8b76be04dc437100c46626db5fe9dd7f0 (patch)
tree81d24efc17ab8045017d94d4be739879d5dccdd6 /lib
parentd6814fa24f403c9152ab9727782d45f9f5f2c446 (diff)
Avoid crashing at a random ISEQ access
[Feature #19420]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby_vm/mjit/exit_compiler.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ruby_vm/mjit/exit_compiler.rb b/lib/ruby_vm/mjit/exit_compiler.rb
index b664d795b0..1d704a8dca 100644
--- a/lib/ruby_vm/mjit/exit_compiler.rb
+++ b/lib/ruby_vm/mjit/exit_compiler.rb
@@ -83,7 +83,7 @@ module RubyVM::MJIT
def compile_branch_stub(ctx, asm, branch_stub, target0_p)
# Call rb_mjit_branch_stub_hit
iseq = branch_stub.iseq
- if C.imemo_type(iseq) != C.imemo_iseq # Guard against ISEQ GC at random moments
+ if C.mjit_opts.dump_disasm && C.imemo_type(iseq) == C.imemo_iseq # Guard against ISEQ GC at random moments
asm.comment("branch stub hit: #{iseq.body.location.label}@#{C.rb_iseq_path(iseq)}:#{iseq_lineno(iseq, target0_p ? branch_stub.target0.pc : branch_stub.target1.pc)}")
end
asm.mov(:rdi, to_value(branch_stub))