(instrs: &[Instruction], target: u32)
| 790 | } |
| 791 | |
| 792 | fn resolve_jump_target(instrs: &[Instruction], target: u32) -> u32 { |
| 793 | let mut idx = next_non_nop(instrs, target as usize); |
| 794 | let mut steps = 0usize; |
| 795 | |
| 796 | while idx < instrs.len() && steps < instrs.len() { |
| 797 | match instrs[idx] { |
| 798 | Instruction::Jump(next) => { |
| 799 | idx = next_non_nop(instrs, next as usize); |
| 800 | steps += 1; |
| 801 | } |
| 802 | _ => break, |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | idx as u32 |
| 807 | } |
| 808 | |
| 809 | fn jump_target(instr: Instruction) -> Option<u32> { |
| 810 | Some(match instr { |
no test coverage detected