binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Add a command line flag enabling standard final types

Open tlively opened this issue 1 year ago • 4 comments

To avoid breaking users who have not updated their frontends yet, Binaryen still interprets binary and text type definitions that do not use sub or sub final as non-final, even though the spec says that they should be final.

Add a flag, --standard-final-types, changing this behavior to match the spec for use in validating updated frontends and to allow compatibility with standard-compliant engines. Update the fuzzer to use this flag for compatibility with V8.

tlively avatar Jul 11 '23 01:07 tlively

  • #5808 Graphite 👈
  • #5816 Graphite
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tlively and the rest of your teammates on Graphite Graphite

tlively avatar Jul 11 '23 01:07 tlively

The fuzzer quickly crashes on this because it picks up initial contents that are not valid under --standard-final-types. I think the best fix will be to fix all the tests to parse correctly under that flag.

tlively avatar Jul 11 '23 02:07 tlively

Fixing the tests to parse properly sgtm. Another option might be to temporarily add logic in the fuzzer to use either this flag or not use it, and to not use initial contents when it is used. But that might be more work overall.

kripken avatar Jul 11 '23 15:07 kripken

The fuzzer found a problem that was caused by two types that differed in finality being emitted into the text format with the same generated name, which caused the TrapsNeverHappen fuzz handler to parse the filtered wast incorrectly, leading to an unexpected trap. I'll fix that in a separate prerequisite PR that changes how type names are generated.

tlively avatar Jul 13 '23 02:07 tlively