Wasm EH, used with either of Emscripten SjLj or Wasm SjLj, does not
allow setjmp calls to be placed within a catch clause, because we
don't support jumping into a catch block. Emscripten EH does not have
this restriction. But I think this restriction wouldn't prevent most of
use cases. This CL errors out with a clear messsage for this case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Wasm EH, used with either of Emscripten EH or Wasm EH, does not allow
Do you mean "Wasm SjLj?"
Seems reasonable to me, this restriction doesn't worry me, and great to have a clear error.
The main culprit(?) is Wasm EH. This doesn't work for Wasm EH + Emscripten SjLj either. But Wasm EH + Emscripten SjLj, which was never meant to be a final recommended way to use EH + SjLj but was used as an interim step until Wasm SjLj is not done, even has a broader restriction, so using setjmp with try-catch within the same function will fail anyway.
Mostly I was confused by the fact that it says Wasm EH "used with" either Emscripten EH (which doesn't make sense) or Wasm EH (redundant). But I guess you mean the wasm EH primitive, used to implement C++ EH and setjmp/longjmp?
Oh sorry, what I meant was "Wasm EH used with either Emscripten SjLj or Wasm SjLj". I fixed the CL description too.