Skip to content

Commit bb31266

Browse files
Debug crash
1 parent f8ccc0a commit bb31266

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

zjit/src/hir.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,6 +3922,11 @@ impl ProfileOracle {
39223922
// operand_types is always going to be <= stack size (otherwise it would have an underflow
39233923
// at run-time) so use that to drive iteration.
39243924
for (idx, insn_type_distribution) in operand_types.iter().rev().enumerate() {
3925+
if idx >= state.stack_size() {
3926+
let pc = unsafe { rb_iseq_pc_at_idx(state.iseq, iseq_insn_idx.try_into().unwrap()) };
3927+
let opcode: usize = unsafe { rb_iseq_opcode_at_pc(state.iseq, pc) }.try_into().unwrap();
3928+
eprintln!("******************************** OH NO {} - {} - {}", idx, state.stack_size(), insn_name(opcode));
3929+
}
39253930
let insn = state.stack_topn(idx).expect("Unexpected stack underflow in profiling");
39263931
entry.push((insn, TypeDistributionSummary::new(insn_type_distribution)))
39273932
}

0 commit comments

Comments
 (0)