Skip to content

Commit

Permalink
fix: val_cnt for if
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwfang committed Dec 23, 2024
1 parent 5c7889b commit f3d4e21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/interpreter/src/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,10 @@ impl<'a, 'm> Expr<'a, 'm> {
}
If(b) => {
self.pop_check(ValType::I32)?;
let branch = self.branch_source();
self.push_label(self.blocktype(&b)?, LabelKind::If(branch))?;
let mut branch = self.branch_source();
let type_ = self.blocktype(&b)?;
branch.result = type_.results.len();
self.push_label(type_, LabelKind::If(branch))?;
}
Else => {
match core::mem::replace(&mut self.label().kind, LabelKind::Block) {
Expand Down

0 comments on commit f3d4e21

Please sign in to comment.