Skip to content

Reduce delta_ip by 1 for "if without else" in validation#696

Merged
ia0 merged 3 commits into
google:dev/fast-interpfrom
zhouwfang:fix-if-without-else
Dec 5, 2024
Merged

Reduce delta_ip by 1 for "if without else" in validation#696
ia0 merged 3 commits into
google:dev/fast-interpfrom
zhouwfang:fix-if-without-else

Conversation

@zhouwfang

@zhouwfang zhouwfang commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

Jumping from "if without else" should be 1 step less than jumping from "if with else". For "if without else", we don't want to jump over the "end" because exit_label() need to be called at the "end". But for "if with else", we want to jump over the "else" because otherwise we would be forced to jump to the "end" at "else" (normally, we would reach "else" after executing the true branch of "if", and we should not execute the "else" branch).

This is equivalent to https://github.com/google/wasefire/blob/main/crates/interpreter/src/parser.rs#L566-L569, which will be deprecated with the side table applied in exec.rs.

#46

@zhouwfang
zhouwfang requested a review from ia0 as a code owner December 4, 2024 05:13
Comment thread crates/interpreter/src/valid.rs Outdated
@ia0
ia0 merged commit 9584b18 into google:dev/fast-interp Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants