Skip to content

Fix cont.wast func returning a cont ref to JS#138

Merged
fgmccabe merged 1 commit intoWebAssembly:mainfrom
thibaudmichaud:main
Mar 5, 2026
Merged

Fix cont.wast func returning a cont ref to JS#138
fgmccabe merged 1 commit intoWebAssembly:mainfrom
thibaudmichaud:main

Conversation

@thibaudmichaud
Copy link
Contributor

The function "null-new" in cont.wast returns a cont ref, so when compiled to JavaScript, the function invocation results in a type error instead of the expected null dereference trap. Just drop the return, it is not relevant for this test.

The function "null-new" in cont.wast returns a cont ref, so when
compiled to JavaScript, the function invocation results in a type error
instead of the expected null dereference trap. Just drop the return, it
is not relevant for this test.
Copy link
Collaborator

@fgmccabe fgmccabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
We may also need a test that includes functions actually returning continuations.

@fgmccabe fgmccabe merged commit 393b3dd into WebAssembly:main Mar 5, 2026
1 check passed
(cont.new $k1
(ref.null $f1)
)
(unreachable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general tools/engines other than the reference interpreter do not actually compare their error messages against the error messages in assert_trap assertions because it is expected that their error messages might be different. The trap from the unreachable here can therefore make the test appear to pass even if there is a bug that lets cont.new succeed without trapping. It would be better to use a drop instead.

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.

3 participants