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

Legacy Exception Handling #60

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GerardSmit
Copy link

@GerardSmit GerardSmit commented Dec 28, 2022

This PR implements https://github.com/WebAssembly/exception-handling. The following is done:

Module structure

  • Tags
    • Clean-up
    • Import
    • Export
    • Name section

Control flow operators

  • try
  • catch
  • catch_all
  • delegate
  • throw
  • rethrow

Other tasks

  • Fix possible out of range exceptions (when the tag index is out of range).
  • Resolve all TODO's in code:
    • Verify expected result type if there is no value
    • Validate for invalid tags in throw and catch
    • Validate for invalid argument types in throw

In C# I've created a WebAssemblyException which is thrown by the IL generator.
If the exception has parameters, the generic type will be used (WebAssemblyException<T0> and WebAssemblyException<T0, T1>. This is to prevent boxing.

@RyanLamansky
Copy link
Owner

As noted in #59, I don't want to merge the WebAssembly. prefixing in the OpCode XML due to that being a Rider bug. Any chance you could rebase without those changes to cut down on the size of this PR? Other than that, I'm pretty excited about what you've accomplished here.

@GerardSmit GerardSmit changed the title Exception Handling Legacy Exception Handling Aug 27, 2024
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