wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

Skip over unsupported instructions instead of panicking

Open Liamolucko opened this issue 3 years ago • 1 comments

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.

Liamolucko avatar Aug 13 '22 02:08 Liamolucko

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.

alexcrichton avatar Aug 15 '22 14:08 alexcrichton

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

See #3421.

daxpedda avatar May 11 '23 15:05 daxpedda