Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
--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.
- 主要言語
- WebAssembly
- スター
- 8.7k
- フォーク
- 893
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 105
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/binaryen のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
WebAssembly/binaryen#9135 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 76/100
WebAssembly/binaryen#9018 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
WebAssembly/binaryen#9246 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
WebAssembly/binaryen#9244 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
WebAssembly/binaryen#9243 ·
メンテナーはふだん 1 日以内に返信
WebAssembly/binaryen の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 5 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
partiql/partiql-lang-kotlin#1972 ·
-
area:protocol bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area:backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Chelis-Lang/chelis#3500 ·
メンテナーはふだん 1 日以内に返信