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

Improve "Trap Handling" for out of bounds memory access and other traps #43

Open
bushidocodes opened this issue Jul 22, 2021 · 0 comments

Comments

@bushidocodes
Copy link
Contributor

According to the WebAssembly specification, abnormal behavior, such as an out-of-bounds memory access, should trigger a "trap."

image
Source:

In the web context, this causes a JavaScript exception. However, the WebAssembly specification is being extended to support "in module" trap handlers (https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md)

Currently, we are mostly enforcing invariants via assert. We should likely replace this with a centralized entrypoint for trap handling logic called via setjmp and longjmp. I believe this would just log a descriptive and error out for 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

No branches or pull requests

1 participant