Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwfang committed Oct 28, 2024
1 parent 5d2fffb commit cc29418
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/interpreter/src/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ impl SideTable {
fn pop_cnt(source: SideTableBranch, target: SideTableBranch) -> MResult<u32, Check> {
let source = source.stack;
let target = target.stack;
let Some(delta) = target.checked_sub(source) else {
let Some(delta) = source.checked_sub(target) else {
#[cfg(feature = "debug")]
eprintln!("side-table negative stack delta {target} < {source}");
eprintln!("side-table negative stack delta {source} < {target}");
return Err(unsupported(if_debug!(Unsupported::SideTable)));
};
u32::try_from(delta).map_err(|_| {
Expand Down Expand Up @@ -880,6 +880,7 @@ impl<'a, 'm> Expr<'a, 'm> {
fn branch_source(&mut self, result: usize) -> SideTableBranch<'m> {
let mut branch = self.branch_target();
branch.result = result;
branch.stack += self.stack().len();
self.side_table.branch();
branch
}
Expand Down

0 comments on commit cc29418

Please sign in to comment.