Skip to content

Allow bare try blocks for exceptions - #289

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
takikawa:allow-bare-try
Jun 15, 2021
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
takikawa:allow-bare-try

Conversation

@takikawa

Copy link
Copy Markdown
Contributor

This PR add support for bare try blocks (try blocks that have no catch, delegate, etc). These are equivalent to a plain block and were added to the spec recently (in order to simplify the grammar and avoid special cases): WebAssembly/exception-handling#157

There's a PR pending review for wabt as well: WebAssembly/wabt#1676

I tested the wasm-tools patch against the pending wabt PR and I believe they should agree. It should be ok to merge this before wabt as the only conflicting test is a failure test (bad-try-no-catch.txt) that is not run by roundtrip.rs.

@takikawa

Copy link
Copy Markdown
Contributor Author

I tested the wasm-tools patch against the pending wabt PR and I believe they should agree. It should be ok to merge this before wabt as the only conflicting test is a failure test (bad-try-no-catch.txt) that is not run by roundtrip.rs.

Whoops, this was not quite right as local/try.wat with the new case added makes wabt (submodule revision) and wasm-tools disagree. I'll try adjusting the skipped tests.

The exception handling spec now allows bare `try` blocks that
have no corresponding `catch` (or other) clauses following it.
These blocks are semantically equivalent to `block`.

Related spec PR:

  WebAssembly/exception-handling#157
@alexcrichton

Copy link
Copy Markdown
Member

Thanks for this!

If you'd like a new publish with these changes and updates just let me know as well.

@alexcrichton
alexcrichton merged commit 761df25 into bytecodealliance:main Jun 15, 2021
@takikawa

Copy link
Copy Markdown
Contributor Author

@alexcrichton Oh yes, thanks that would be helpful! :) This is the last PR I have for this current batch of changes, so a version bump and publish would be helpful to be able to use this from SpiderMonkey tests.

@takikawa
takikawa deleted the allow-bare-try branch June 15, 2021 21:25
@alexcrichton

Copy link
Copy Markdown
Member

Ok, published now!

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