Skip to content

[EH] Allow catch/delegate-less trys - #3924

Merged
aheejin merged 2 commits into
WebAssembly:mainfrom
aheejin:no_catch
Jun 11, 2021
Merged

aheejin merged 2 commits into
WebAssembly:mainfrom
aheejin:no_catch

Conversation

@aheejin

@aheejin aheejin commented Jun 7, 2021

Copy link
Copy Markdown
Member

This removes the restriction that try should have at least one
catch/catch_all/delegate. See WebAssembly/exception-handling#157.

This removes the restriction that `try` should have at least one
`catch`/`catch_all`/`delegate`. See WebAssembly/exception-handling#157.
@aheejin
aheejin requested review from kripken and tlively June 7, 2021 17:51
Comment thread src/wasm/wasm-binary.cpp Outdated
lastSeparator != BinaryConsts::CatchAll &&
lastSeparator != BinaryConsts::Delegate) {
throwError("No catch instruction within a try scope");
throwError("try scope should contain only catch/catch_all/delegate");

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.

IIUC, this will never happen because the only other value lastSeparator could have is BinaryConsts::End, which is already handled. Is this intentionally meant to be future-proof against new separators being added in the future? If not, it might be simpler just to remove this check entirely.

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.

Sounds good; removed.

@aheejin
aheejin merged commit ca263c0 into WebAssembly:main Jun 11, 2021
@aheejin
aheejin deleted the no_catch branch June 11, 2021 06:45
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.

3 participants