Skip to content

Commit

Permalink
YJIT: Fix assert in OOM scenario
Browse files Browse the repository at this point in the history
We still need to do `jit.record_boundary_patch_point = false`
when gen_outlined_exit() returns `None` and we return with `?`.
Previously, we tripped the assert at codegen.rs:1042.

Found with `--yjit-exec-mem-size=3` on the lobsters benchmark.

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
  • Loading branch information
3 people committed Nov 7, 2023
1 parent a1c61f0 commit 7367336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yjit/src/codegen.rs
Expand Up @@ -853,10 +853,10 @@ fn jump_to_next_insn(

// We are at the end of the current instruction. Record the boundary.
if jit.record_boundary_patch_point {
jit.record_boundary_patch_point = false;
let exit_pc = unsafe { jit.pc.offset(insn_len(jit.opcode).try_into().unwrap()) };
let exit_pos = gen_outlined_exit(exit_pc, &reset_depth, ocb);
record_global_inval_patch(asm, exit_pos?);
jit.record_boundary_patch_point = false;
}

// Generate the jump instruction
Expand Down

0 comments on commit 7367336

Please sign in to comment.