How would setjmp/longjmp be implemented in WebAssembly?

Viewed 1736

I've just started looking at WebAssembly MVP, and notice that there is no access to the stack and stack pointer, or indeed any structured exception handling support (throw/catch) etc.

Given it is supposed to be a C compilation target, it surely must be possible to implement setjmp and longjmp, but I can't fathom how this can be done nicely. How does this construct look in wast?

1 Answers
Related