binaryen
binaryen copied to clipboard
Add a command line flag enabling standard final types
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.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @tlively and the rest of your teammates on Graphite
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.
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.
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.