Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebAssembly] Exception specifications don't work in Emscripten EH & Wasm EH (except for throw()) #49740

Open
aheejin opened this issue May 18, 2021 · 0 comments
Labels
backend:WebAssembly bugzilla Issues migrated from bugzilla

Comments

@aheejin
Copy link
Member

aheejin commented May 18, 2021

Bugzilla Link 50396
Version trunk
OS All
CC @kripken,@dschuff

Extended Description

It turns out Emscripten EH hasn't supported dynamic exception specification all along. For example, the program prints "Incorrect", which it shouldn't:

#include <stdio.h>

void test() throw(float) { throw 3; }

int main() {
  try {
    test();
  } catch (int n) {
    printf("Incorrect\n");
  }
  return 0;
}

It supports throw() correctly, but for other types within throw(..), Emscripten EH currently allows all types to be thrown.

We are working on the new wasm EH based on the the wasm spec (https://github.com/WebAssembly/exception-handling), but this currently has the same limitation: it also only supports throw() and not other throw(..).

For both Emscripten EH (the current EH) and the new wasm EH (currently experimental and new browser support is necessary) the exception spec except for throw() has never worked, and we don't have a short-term plan to fix this in near future. Patches are welcome though.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:WebAssembly bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant