-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are block labels supported? #796
Comments
WebAssembly/design#1064 includes it |
What do you mean by "this doesn't work"? The labeled version of your code should work fine, and does in the reference interpreter. What tool were you using? There are plenty of uses of labels in the test suite, see e.g. labels.wast or stack.wast. |
Thanks @rossberg - I've narrowed things down a bit. I'm using the WeAssembly build of wabt:
Which is giving the following error:
Whereas, compiling the same file with Anyhow, closing this issue :-) |
Thanks @xtuc that explains why I'm not seeing the labels in custom name section. Anyhow, I'll investigate that compiler error to see if I can find the root cause. |
@ColinEberhardt yeah, I believe someone else ran into the same issue recently. You have to call |
ref: xtuc/webassemblyjs#277 - I am struggling to make block labels work.
The spec indicates that blocks can have an optional label, and that
br
/br_if
instructions may use a label or index.Here's a simple function that counts to twenty:
This works just fine.
My expectation is that the
br_if
instruction can reference the block by name rather than depth. For example:However this doesn't work.
I've been looking at the spec test suite and can only see one block with a label, but it is unused:
https://github.com/WebAssembly/testsuite/blob/master/block.wast#L9
I'd appreciate some help, or a working example :-)
The text was updated successfully, but these errors were encountered: