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
Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validation #9245
--memory64-lowering turns an i64 table into an i32 table but leaves the i64 index of table.get and table.set unwrapped, so the output fails validation.
[wasm-validator error in function f] i64 != i32: table.set index must match the table index type., on
(table.set $t
(i64.const 0)
(local.get $0)
)
[wasm-validator error in function f] i64 != i32: table.get index must match the table index type., on
(table.get $t
(i64.const 0)
)
Fatal: error after opts
I expected the pass to wrap these indices to i32 the way it does for the other table instructions, giving a valid module. The input itself validates (wasm-opt -all input.wat -o /dev/null exits 0).
Found at commit 93d6e9d and still reproduces at 611832f. A normal release build shows it as above (exit 1). With BINARYEN_PASS_DEBUG=1 the same errors are followed by Fatal: Last pass (memory64-lowering) broke validation.
Looks like src/passes/Memory64Lowering.cpp wraps the i64 operands of table.size/grow/fill/copy/init through wrapTableAddress64 but has no visitTableGet/visitTableSet, so those indices stay i64.
Found with an LLM-based testing tool; I used Claude to reduce it and look for the cause.
We can imagine that there could a some users out there who like this because it allows them to use 64-bit pointers in their code but still run on browsers without wasm64.... seem quite unlikely that they exist though.
Activity
kripken commentedon Oct 12, 2026
@sbc100 do we still need Memory64Lowering or can we remove it, do you think?
sbc100 commentedon Oct 12, 2026
We can imagine that there could a some users out there who like this because it allows them to use 64-bit pointers in their code but still run on browsers without wasm64.... seem quite unlikely that they exist though.