Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validation
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 66/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
--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.
- Linguagem predominante
- WebAssembly
- Estrelas
- 8.7k
- Forks
- 893
- Merge médio
- 1d 18h
- PRs com merge (30d)
- 95
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de WebAssembly/binaryen
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
WebAssembly/binaryen#9135 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 76/100
WebAssembly/binaryen#9018 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 65/100
WebAssembly/binaryen#9244 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
WebAssembly/binaryen#9243 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 18/100
WebAssembly/binaryen#9237 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de WebAssembly/binaryen
Issues semelhantes
-
IO.get_env on Node truncates names at embedded NULTalvez já em andamento @Yi-111-a assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
HigherOrderCO/Bend#1449 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
projectM-visualizer/projectm#1043 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
grame-cncm/faust#1344 · 1 comentário ·
Mantenedores costumam responder em até 1 dia