Reference interpreter, step Return, clear stack#1101
Merged
rossberg merged 1 commit intoWebAssembly:masterfrom Nov 16, 2019
Merged
Reference interpreter, step Return, clear stack#1101rossberg merged 1 commit intoWebAssembly:masterfrom
rossberg merged 1 commit intoWebAssembly:masterfrom
Conversation
according to https://webassembly.github.io/spec/core/exec/instructions.html#exec-return the `Return` instruction pops the top of the stack, until the next frame. The equivalent in the reference interpreter should be to set the value stack to `[]`. This is what is happening for `Break` as well. So for consistency, also do it here. This has no visible effect: If the first instruction is `Returning`, the stack is ignored.
Contributor
Author
|
(I just connected Github to my W3 account.) |
raoxiaojia
pushed a commit
to WasmCert/spec
that referenced
this pull request
Apr 29, 2025
according to https://webassembly.github.io/spec/core/exec/instructions.html#exec-return the `Return` instruction pops the top of the stack, until the next frame. The equivalent in the reference interpreter should be to set the value stack to `[]`. This is what is happening for `Break` as well. So for consistency, also do it here. This has no visible effect: If the first instruction is `Returning`, the stack is ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
according to
https://webassembly.github.io/spec/core/exec/instructions.html#exec-return
the
Returninstruction pops the top of the stack, until the nextframe. The equivalent in the reference interpreter should be to set
the value stack to
[]. This is what is happening forBreakas well.So for consistency, also do it here.
This has no visible effect: If the first instruction is
Returning, thestack is ignored everywhere. So this is purely cosmetic.
(I am only 80% sure; if not I hope to at least learn something here.)