[all-commits] [llvm/llvm-project] aca198: [WebAssembly] Error out when Emscripten SjLj setjm...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Thu Aug 12 16:19:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aca198cf748e32205a835fba2d6d68f95ba1dfdd
      https://github.com/llvm/llvm-project/commit/aca198cf748e32205a835fba2d6d68f95ba1dfdd
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2021-08-12 (Thu, 12 Aug 2021)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    A llvm/test/CodeGen/WebAssembly/wasm-eh-em-sjlj-error.ll

  Log Message:
  -----------
  [WebAssembly] Error out when Emscripten SjLj setjmp is used with Wasm EH

Currently, when Wasm EH is used with Emscripten SjLj, Emscripten SjLj
cannot handle `invoke` instructions - it assumes all `invoke`s have been
lowered away with Emscripten EH. But in Wasm EH they are lowered in
instruction selection, so they are still present in the IR stage. This
happens when
1. Wasm EH and Emscripten SjLj are used together
2. A function that calls `setjmp` uses exceptions, i.e., has `invoke`s

We were already erroring out with an assertion failure in this case, but
this CL makes it error out more properly with a valid error message.

Wasm EH + Wasm SjLj will not have this restrictions. (it will have
another restriction though, e.g., `setjmp` cannot be called within
`catch`. But why would anyone do that..)

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D107687




More information about the All-commits mailing list