[PATCH] D65358: [WebAssembly] allow EM_ASM to be used with setjmp

Alon Zakai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 17:11:27 PDT 2019


kripken added a comment.

Interesting!

To make sure I understand, is the issue that in the presence of a setjmp we turn those calls into invokes, which means in wasm we end up with an indirect call - and then in binaryen we don't see the `emscripten_asm_const_int` etc., and instead just the indirect call? (Or does the backend do more processing here?)

if so, then I'm not sure this is the correct fix, since EM_ASM calls *may* throw (not just JS exceptions, but also they may call back into compiled code and do a longjmp from there, and that should work). Perhaps what we need to do is, in Binaryen, look at indirect calls and see if they are done with a constant index, and the function at that index is `emscripten_asm_const_int`? (Maybe this is what you were thinking earlier, and I didn't understand it? Sorry if so!)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65358/new/

https://reviews.llvm.org/D65358





More information about the llvm-commits mailing list