binaryen
binaryen copied to clipboard
Bad i64.const constant
Consider test.wat:
$ cat /tmp/test.wat
(module
(func $f (export "f") (result i64)
(i64.const 0x8000_0000)))
There is a bug parsing the constant:
$ ~/src/binaryen/bin/wasm-as -o /tmp/test.wasm /tmp/test.wat
$ ~/src/v8/out/x64.release/d8 -e 'print(new WebAssembly.Instance(new WebAssembly.Module(read("/tmp/test.wasm", "binary"))).exports.f())'
32768
If I remove the _ then it does parse as expected.
This should already work correctly in the new parser.