Skip to content

Commit

Permalink
Fix dispatch in tail loop
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 16, 2025
1 parent 2fb2ee8 commit 7e8550e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pulley/src/interp/tail_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn dispatch(
debug.before_visit();
let opcode = unwrap_uninhabited(Opcode::decode(debug.bytecode()));
let handler = OPCODE_HANDLER_TABLE[opcode as usize];
tail_call!(handler(state, pc, executing_pc));
tail_call!(handler(debug.0.state, debug.0.pc, debug.0.executing_pc));
}

/// Same as `Interpreter::run`, except for extended opcodes.
Expand Down Expand Up @@ -178,7 +178,9 @@ macro_rules! define_opcode_handler {
let result = debug.$snake_name($($($field),*)?);
debug.after_visit();
match result {
ControlFlow::Continue(()) => tail_call!(dispatch(state, pc, executing_pc)),
ControlFlow::Continue(()) => {
tail_call!(dispatch(debug.0.state, debug.0.pc, debug.0.executing_pc))
}
ControlFlow::Break(done) => done,
}
}
Expand Down

0 comments on commit 7e8550e

Please sign in to comment.