Skip to content

fix(test): correct expected test invocation#2100

Closed
marxin wants to merge 1 commit intoWebAssembly:mainfrom
marxin:fix-try_table-test
Closed

fix(test): correct expected test invocation#2100
marxin wants to merge 1 commit intoWebAssembly:mainfrom
marxin:fix-try_table-test

Conversation

@marxin
Copy link
Contributor

@marxin marxin commented Mar 6, 2026

In both tested tail-call invocations, the exception is thrown, but caught. That's why we can't use assert_exception.

In both tested tail-call invocations, the exception is thrown, but
caught. That's why we can't use assert_exception.
@marxin
Copy link
Contributor Author

marxin commented Mar 6, 2026

Apparently, it's a documented/discussed spec corner case: WebAssembly/exception-handling#249.

@marxin marxin closed this Mar 6, 2026
@rossberg
Copy link
Member

rossberg commented Mar 6, 2026

Right, the semantics of return_call is to first unwind the current call frame and then call the function. That's what makes it a tail call. It doesn't matter if the current call frame had a handler before, that is gone by the time the next function is called. If a producer wants exceptions from the callee to be caught, it should not generate a tail call.

@marxin
Copy link
Contributor Author

marxin commented Mar 6, 2026

Gotcha, thanks for clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants