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

wasm: add recover() support #4380

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

wasm: add recover() support #4380

wants to merge 2 commits into from

Commits on Aug 14, 2024

  1. compiler: support panics inside indirect deferred functions

    Found this bug while working on WebAssembly recover support.
    aykevl committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    2f7952f View commit details
    Browse the repository at this point in the history
  2. wasm: add recover support

    Add unwinding and recover support for wasm using WebAssembly exception
    handling. This still has a few gotchas:
    
      * Many WASI systems don't support exception handling yet.
        For example, see:
        bytecodealliance/wasmtime#2049
      * Asyncify doesn't support wasm exception handling:
        WebAssembly/binaryen#4470
        This means it's not possible to use goroutines together with
        panic/recover.
      * The current way that exceptions are implemented pretend to be C++
        exceptions, but work slightly differently. If C++ code is called
        (for example through CGo) that raises an exception, that exception
        will be eaten by TinyGo and not be propagated. This is fixable, it
        just hasn't been implemented (because we don't actually support C++
        right now).
    
    I hope that these issues will be resolved over time. At least for now,
    people who need `recover()` have a way to use it.
    aykevl committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    89ffb47 View commit details
    Browse the repository at this point in the history