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 摘要。