Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Dec 5, 2024

Similar to call-export*, these imports call a wasm function from outside the
module. The difference is that we send a function reference for them to call
(rather than an export index).

This gives more coverage, first by sending a ref from wasm to JS, and also
since we will now try to call anything that is sent. Exports, in comparison,
are filtered by the fuzzer to things that JS can handle, so this may lead to
more traps, but maybe also some new situations. This also leads to adding
more logic to execution-results.h to model JS trapping properly.

fuzz_shell.js is refactored to allow sharing code between call-export* and
call-ref*.

@kripken kripken requested a review from tlively December 5, 2024 19:08
target = callExportImportName;
} else if (type == Type::i32) {
target = callExportCatchImportName;
if (type == Type::i32) {
Copy link
Member

Choose a reason for hiding this comment

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

The comment below that says "This never traps.. but we do still want to avoid trapping..." seems to contradict itself about whether traps are possible. Can we clarify it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Clarified. The issue is swallowing traps: we always swallow them, but still prefer not to have any trap at all.

Copy link
Member

Choose a reason for hiding this comment

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

Should this also say "exceptions" instead of "traps"?

Copy link
Member Author

Choose a reason for hiding this comment

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

😆 yeah, sorry, it seems I have difficulty not using "trap" as a catchall for "error". fixed.

kripken and others added 7 commits December 5, 2024 16:16
Co-authored-by: Thomas Lively <tlively123@gmail.com>
Co-authored-by: Thomas Lively <tlively123@gmail.com>
Co-authored-by: Thomas Lively <tlively123@gmail.com>
Co-authored-by: Thomas Lively <tlively123@gmail.com>
kripken and others added 4 commits December 5, 2024 16:46
@kripken kripken merged commit 7f62a42 into WebAssembly:main Dec 9, 2024
13 checks passed
@kripken kripken deleted the fuzz.call.ref branch December 9, 2024 22:46
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