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

Skip over unsupported instructions instead of panicking #3029

Closed
wants to merge 1 commit into from

Conversation

Liamolucko
Copy link
Collaborator

Fixes #2969

This changes wasm-bindgen-wasm-interpreter to ignore a function rather than panicking if it contains an unsupported instruction. This works around some runtime glue that gets added to our descriptor functions on the WASI target by more-or-less ignoring them.

I also put some work into making sure a helpful error message is given if the actual describe function contains unsupported instructions, by keeping track of the instructions that caused us to skip and including them in the error message if the descriptor is invalid.

Fixes rustwasm#2969

This changes `wasm-bindgen-wasm-interpreter` to ignore a function rather than panicking if it contains an unsupported instruction. This works around some runtime glue that gets added to our descriptor functions on the WASI target by more-or-less ignoring them.

I also put some work into making sure a helpful error message is given if the actual describe function contains unsupported instructions, by keeping track of the instructions that caused us to skip and including them in the error message if the descriptor is invalid.
@alexcrichton
Copy link
Contributor

I think that the better error messages here are definitely good to have, but I would prefer to not skip over unknown functions. We can't really say ahead of time whether they'll be crucial to the execution and final result or not, so I wouldn't be comfortable automatically skipping them.

@daxpedda
Copy link
Collaborator

I will close this for now as it mostly addresses a WASI issue, apart from what alexcrichton said.

See #3421.

@daxpedda daxpedda closed this May 11, 2023
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.

wasm-bindgen panics at local.tee instruction
3 participants