Skip to content

Commit

Permalink
fix: StateInterface::current_frame did not work with near calls (#65)
Browse files Browse the repository at this point in the history
StateInterface::current_frame returned the latest far call instead of
the latest frame before this fix.
  • Loading branch information
joonazan authored Sep 20, 2024
1 parent e8e72b5 commit 53f8f88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/vm2/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ impl<T: Tracer, W> StateInterface for VirtualMachine<T, W> {
}

fn current_frame(&mut self) -> impl CallframeInterface + '_ {
let near_call = self.state.current_frame.near_calls.len().checked_sub(1);
CallframeWrapper {
frame: &mut self.state.current_frame,
near_call: None,
near_call,
}
}

Expand Down

0 comments on commit 53f8f88

Please sign in to comment.