Stream: git-wasmtime

Topic: wasmtime / issue #2049 Exception support


view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2025 at 03:27):

cfallin closed issue #2049:

<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->

Feature

Cranelift currently doesn't support SEH (but has some support for finally I think). This is a feature request to support properly exception (landingpads on Posix, SEH on windows, maybe SLJL for others)

Benefit

WASM has plans to support exceptions, at which point it's going to be needed. Win64 has partial SEH support (iirc it just emits what's needed, nothing more), this would allow for c++ /java/.net exception support.

Implementation

Tricky one. I know LLVM has two alternative ways of doing this. I think with that in mind it should be possible to do a single implementation. What's basically needed is a way to say:
from here
[code]

till here is a protected block, on exceptions go to X, for finalization go to Y. For the handler itself it should be possible to define the personality to call.

Throw, Rethrow etc can all probably be done on a library level.

Alternatives

The only alternative is to not do it.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2025 at 03:27):

cfallin commented on issue #2049:

Cranelift supports exceptions now, and they are used by Wasmtime exception handling and cg_clif panic-unwind support; closing issue.


Last updated: Dec 06 2025 at 07:03 UTC