Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 66/100
Direzione di ricerca
Start in src/passes/Memory64Lowering.cpp, where the reporter says table.size, grow, fill, copy and init already wrap their i64 operands with wrapTableAddress64 but table.get and table.set have no handler. Read how one of those existing visitors is written, then add the same wrapping for the index of table.get and table.set. Done when the reproducer in the issue passes wasm-opt -all --memory64-lowering with exit 0 and the output validates.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
--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.
(module
(table $t i64 1 funcref)
(func $f (param $r funcref)
(table.set $t (i64.const 0) (local.get $r))
(drop (table.get $t (i64.const 0)))))
wasm-opt input.wat -all --memory64-lowering -o /dev/null
[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 93d6e9de7e1d99be22a49b8952426906a65df397 and still reproduces at 611832f3397d. 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.
- Lingua principale
- WebAssembly
- Stelle
- 8.7k
- Fork
- 895
- Merge medio
- 1g 23h
- PR unite (30g)
- 105
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/binaryen
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
WebAssembly/binaryen#9135 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 76/100
WebAssembly/binaryen#9018 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
WebAssembly/binaryen#9246 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
WebAssembly/binaryen#9244 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
WebAssembly/binaryen#9243 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WebAssembly/binaryen
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jaseci-labs/jac#9934 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rescript-lang/rescript#8763 ·
I maintainer di solito rispondono entro 1 giorno
-
Booleans are brokenAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
flagos-ai/FlagTree#1344 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno