OCamlPro / wasocaml

Other
54 stars 4 forks source link

Unrecognized instructions in .wast files #2

Closed mkarup closed 1 week ago

mkarup commented 2 months ago

Some of the Wasm text format instructions used when emitting the .wast files are not part of the text format in official GC spec (and by extension, not recognized by Binaryen), meaning that the compilation fails when linking with wasm-merge.

There may be more issues, but here are a few that I spotted in wasm/wast.ml, wasm/runtime_binaryen.wast and wasm/imports_binaryen.wast (I'm not sure if they will actually be used in practice when emitting the wast):

Disclaimer: My suggested fixes may be incorrect (or there is a more elegant way)

zapashcanon commented 2 months ago

Thanks a lot ! It looks like Binaryen is finally implementing the spec exactly. All these instructions are either things that have been renamed in the GC proposal or old custom instructions from Binaryen. :) I'll make a PR to fix these issues.

zapashcanon commented 1 week ago

@mkarup, this should have been fixed by #3. Feel free to re-open if you find another issue. Thanks again for the report!

(Also, please note that there's no more .wast files, I renamed all of them to .wat, it was an old misnaming...)