Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validation

未關閉
#9,245 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
66/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
cpp, wasm
領域
compilers

研究方向

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 天 18 小時
30 天內合併 PR
95

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

WebAssembly/binaryen 的其他 Issue

查看 WebAssembly/binaryen 的全部 Issue

相似的 Issue

更多 Compilers Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。