(&mut self, pos: usize)
| 380 | } |
| 381 | |
| 382 | pub(super) fn patch(&mut self, pos: usize) { |
| 383 | let target = self.chunk.instructions.len() as u16; |
| 384 | // Error recovery can leave a stale placeholder; skip if it was never emitted. |
| 385 | if let Some(ins) = self.chunk.instructions.get_mut(pos) { ins.operand = target; } |
| 386 | } |
| 387 | |
| 388 | /* Patch a jump to an explicit target; bounds-safe so instruction overflow (`emit` freezes at MAX_INSTRUCTIONS) can't panic on a stale index. */ |
| 389 | pub(super) fn patch_to(&mut self, pos: usize, target: u16) { |
no test coverage detected