Skip to content
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

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

Merged
merged 2 commits into from
Jun 11, 2021
Merged

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Jun 7, 2021

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
if (lastSeparator != BinaryConsts::Catch &&
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
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
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