From 22d944c8b76be04dc437100c46626db5fe9dd7f0 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 5 Mar 2023 22:09:57 -0800 Subject: Avoid crashing at a random ISEQ access [Feature #19420] --- lib/ruby_vm/mjit/exit_compiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ruby_vm') 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)) -- cgit v1.2.3