<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WebAssembly] Exception specifications don't work in Emscripten EH & Wasm EH (except for throw())"
   href="https://bugs.llvm.org/show_bug.cgi?id=50396">50396</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[WebAssembly] Exception specifications don't work in Emscripten EH & Wasm EH (except for throw())
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>aheejin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>alonzakai@gmail.com, dschuff@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
(<a href="https://github.com/WebAssembly/exception-handling">https://github.com/WebAssembly/exception-handling</a>), 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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>