diff options
| -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)), } } |
