-
Notifications
You must be signed in to change notification settings - Fork 756
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
Binaryen changes type structure in open world even with zero-level optimization enabled #7219
Comments
Here is how I tried to reproduce this:
Should I be doing something else? |
Hi, the archive contains |
This is going to be due to the fact that we store |
@igoriakovlev ah, you're right, I missed that there was a second wasm file there, sorry. |
Tags in WebAssembly syntactically refer to function heap types, but Binaryen IR was previously storing signatures instead and reconstructing heap types as necessary when emitting binaries. Before WasmGC this was not a problem because the reconstructed types would be the same as the original types, but with WasmGC round tripping function types through Signature could lose information such as the rec group, the declared supertype, and the finality from the original type. Store the original heap type in the IR instead to stop losing this information. Fixes #7219.
@igoriakovlev, are you going to need a new Binaryen release once the fix lands? |
@tlively well, this issue needed for our experiments and I can build it by myself. But it will be nice to release it anyway because of fixes of multivalued blocks. Thank you. |
It seems passing a
.wasm
file could change types structure for exported tag.I use this command to optimise attached example which originally works fine:
wasm-opt --enable-gc --enable-reference-types --enable-exception-handling --enable-bulk-memory --enable-nontrapping-float-to-int --inline-functions with-loops --traps-never-happen --fast-math stdlib.wasm -o xxx.wasm
And get this warning:
no passes specified, not doing any work
, but nevertheless, when I replacestdlib.wasm
withxxx.wasm
and reload app to use optimised.wasm
file I getLinkError: WebAssembly.instantiate(): Import #74 "stdlib" "tag_throwable": imported tag does not match the expected type
So seems binaryen rewrite exported tag type so it cannot be imported.
Reproduced on binaryen 121 and [current master]
binaryen_bug.zip
The text was updated successfully, but these errors were encountered: