You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invalid non-nullable local binary emitting related to unreachability #5599
(module
(func$test (param$ref (refstruct))
(local$local (refstruct))
(drop
(block (resulti32)
(local.set$local
(unreachable) ;; this causes validation of the later local.get to fail;; (local.get $ref) ;; this would be ok
)
(i32.const0)
)
)
(drop
(local.get$local)
)
)
)
bin/wasm-as -all --nominal wat -o wasm emits a binary that V8 complains about, uninitialized non-defaultable local. Binaryen does accept the binary as valid, oddly. Also oddly, replacing the unreachable with something reachable fixes it in V8.
I think Binaryen thinks this validates since the unnamed block is not emitted in the binary format, so the local.set dominates the local.get. But perhaps unreachability makes us behave differently somehow?
We won't emit the local.set $local instruction into the binary, but we will emit the local.get $local, so it makes sense that V8 would complain about this. Replacing the unreachable with something reachable will cause us to emit the local.set, which fixes the problem.
We should update our domination calculation to take into account the fact that unreachable sets won't be emitted.
Activity
tlively commentedon Mar 29, 2023
We won't emit the
local.set $localinstruction into the binary, but we will emit thelocal.get $local, so it makes sense that V8 would complain about this. Replacing the unreachable with something reachable will cause us to emit thelocal.set, which fixes the problem.We should update our domination calculation to take into account the fact that unreachable sets won't be emitted.
Fix #5599
Fuzzer: Run --dce when GC is enabled (#5677)
Fuzzer: Ignore V8 errors on uninitialized non-defaultable locals (#6337)
Fuzzer: Run --dce when GC is enabled (WebAssembly#5677)
Fuzzer: Ignore V8 errors on uninitialized non-defaultable locals (Web…
Preserve unreachable struct.set of non-nullable locals (#8844)