Avoid crashing at a random ISEQ access

[Feature #19420]
This commit is contained in:
Takashi Kokubun 2023-03-05 22:09:57 -08:00
parent d6814fa24f
commit 22d944c8b7
Notes: git 2023-03-06 07:29:26 +00:00
2 changed files with 6 additions and 1 deletions

View file

@ -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))