MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / patch_jump

Method patch_jump

crates/parser/src/visit.rs:622–629  ·  view source on GitHub ↗
(&mut self, jump_ip: usize, target: usize)

Source from the content-addressed store, hash-verified

620 }
621
622 fn patch_jump(&mut self, jump_ip: usize, target: usize) {
623 match &mut self.instructions[jump_ip] {
624 Instruction::Jump(ip) | Instruction::JumpIfNonZero32(ip) => {
625 *ip = target as u32;
626 }
627 _ => {}
628 }
629 }
630
631 fn patch_jump_if_zero(&mut self, jump_ip: usize, target: usize) {
632 if let Instruction::JumpIfZero32(ip) = &mut self.instructions[jump_ip] {

Callers 2

patch_end_jumpsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected