Skip to content

Fix return representation in Ast - #256

Merged
rossberg merged 6 commits into
masterfrom
return
Mar 2, 2016
Merged

rossberg merged 6 commits into
masterfrom
return

Conversation

@rossberg

Copy link
Copy Markdown
Member

Ast.Return improperly had a label argument to support its desugaring. That is now removed, and the logic properly encapsulated in desugaring.

@lukewagner

Copy link
Copy Markdown
Member

Ah, nice, I hadn't even noticed that var straggler.

@rossberg

rossberg commented Mar 2, 2016

Copy link
Copy Markdown
Member Author

@lukewagner, is that an LGTM? :)

Btw, I screwed up my branching, so that #257 is included in this branch. Sorry about that, just look at the first commit.

@lukewagner

Copy link
Copy Markdown
Member

oops, yes :)

rossberg added a commit that referenced this pull request Mar 2, 2016
Fix `return` representation in Ast
@rossberg
rossberg merged commit 8fa4dce into master Mar 2, 2016
@rossberg

rossberg commented Mar 2, 2016

Copy link
Copy Markdown
Member Author

Thanks :)

@rossberg
rossberg deleted the return branch March 2, 2016 17:57
Comment thread ml-proto/test/memory.wast
(if
(i32.eq (get_local 0) (i32.const 0))
(br 1)
(br 2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull is for return - why did these brs change?

And where does 2 go? the only blocks or loops above this br are the one loop, which would take indexes 0 and 1?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if has an implicit label now too. Change was here: 0568800. Not sure why it didn't break then.

edit: oh, it got added in to this merge accidentally.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! now i see

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this, I messed up the branching, and accidentally merged the if changes into the return branch instead of master. This line is part of the if changes (if now has an implicit block).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it the if that has an implicit block, or the then and else branches that do? because I see they can have a label name on them now? must it be the same for both of them if there is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branches have implicit blocks, so the labels go there (also, that makes it clear that they are not in scope in the condition). They can be named differently, see the examples in test/labels.wast.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks!

dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Mar 2, 2023
This makes some cosmetic changes to the identity-preserving `rethrow`
test added in WebAssembly#253. This is to prepare for adding the same set of tests
for a Wasm-defined-and-exported tag, as requrested in
WebAssembly/exception-handling#253 (comment).
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.

4 participants