diff options
| author | Max Bernstein <max.bernstein@shopify.com> | 2025-02-07 09:46:59 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:57 +0900 |
| commit | 9fa2a9aba8e6b6919c1fa403a45dd19797a522e3 (patch) | |
| tree | 69cb8b52ad63d790c6849064567258885d8a4595 | |
| parent | 4ff0109ffdbafedbd3d2ca489d0b0cc7c980916c (diff) | |
Don't make a new block after end of iseq
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index cd58fc6ab8..a31e3f42a5 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -284,7 +284,11 @@ fn compute_jump_targets(iseq: *const rb_iseq_t) -> Vec<u32> { let offset = get_arg(pc, 0).as_i64(); jump_targets.insert(insn_idx_at_offset(insn_idx, offset)); } - YARVINSN_leave => { jump_targets.insert(insn_idx); } + YARVINSN_leave => { + if insn_idx < iseq_size { + jump_targets.insert(insn_idx); + } + } _ => eprintln!("zjit: compute_jump_targets: unknown opcode `{}'", insn_name(opcode as usize)), } } |
