Skip to content

Commit

Permalink
fix bug when branching to a loop (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdetrio authored and yurydelendik committed Feb 21, 2019
1 parent 11d59c9 commit 08cc5ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ impl OperatorValidator {
}
let block = func_state.block_at(relative_depth as usize);
if block.jump_to_top {
if !func_state.assert_last_block_stack_len_exact(reserve_items) {
if !func_state.assert_block_stack_len(0, reserve_items) {
return Err("stack size does not match target loop type");
}
return Ok(());
Expand Down
Binary file added tests/br_if-loop-stack.wasm
Binary file not shown.

0 comments on commit 08cc5ef

Please sign in to comment.