-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I've been able to reproduce the following error:
Uncaught (in promise) CompileError: WebAssembly.instantiateStreaming(): Compiling function #366 failed: type error in fallthru[0] (expected (ref i31), got (ref eq)) @+118976
With a minimal set of code that looks like:
let fn_const r _ = r
let int_of_hex c =
match c with
| '0' .. '9' -> 1
| 'a' -> 0
| _ -> failwith "nope"
;;
let int64_of_hex c = Stdlib.Int64.of_int (int_of_hex c)
let combine = fn_const (int64_of_hex 'c') (int64_of_hex 'c')
let () = print_endline (Stdlib.Int64.to_string combine)
Expected behavior
I'd expect this code to compile and run (with errors)
Versions
This fails when passing --opt 3. If you don't pass an opt flag, the code and wasm both compile. We use a slightly different build of wasm_of_ocaml, so for clarity --opt 3 passes -O3 --skip-pass=inlining-optimizing --traps-never-happen
to binaryen
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working