Spec interpreter/implementation discrepancy - a local with an invalid type and 0 count
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- wasm
- 领域
- compilers
调研方向
Start with the linked code-section specification and the reference interpreter, then reproduce the behavior using foo.wasm and compare it with V8, SpiderMonkey, and Wasmtime. Determine whether a zero-count local's type should be validated or discarded, and document the agreed specification or implementation outcome.
由索引模型根据 Issue 内容生成。
描述
My understanding of the definition of the code section in the online specification is that if an entry in locals has n=0 count that it's discarded and not represented in the AST of a module. This means that the corresponding local's type is parsed, but not validated. The reference interpreter implements this behavior and for this input:
(module binary
"\00asm\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section: 1 type
"\03\02\01\00" ;; Function section: 1 function
"\0a\07" ;; code section, 7 bytes
"\01" ;; 1 function body
"\05" ;; body size, 5 bytes
"\01" ;; 1 locals entry
"\00" ;; count: 0
"\63\01" ;; type: (ref null 1) -- not a valid type index
"\0b" ;; end
)
the spec interpreter passes. This same module (foo.wasm) does not validate in V8, SpiderMonkey, or Wasmtime, however. These engines all validate the local's type and reject the module saying that it's out-of-bounds.
I wanted to raise this as an issue to see if others have thoughts about this. I don't have a preference for how exactly to go here myself.
- 主要语言
- WebAssembly
- 星标
- 3.5k
- 派生
- 543
- 平均合并
- 1 天 28 分钟
- 30 天内合并 PR
- 35
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebAssembly/spec 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
WebAssembly/spec#2321 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
WebAssembly/spec#2302 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 53/100
WebAssembly/spec#2301 · 8 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
WebAssembly/spec#2279 · 6 条评论 ·
维护者通常 1 天内回复
-
[js-api] A mutable global import allocates a const global before LinkError可能已有人在做 @chicoxyzzy 于 32 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
WebAssembly/spec#2253 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 63/100
KhronosGroup/SPIRV-LLVM-Translator#4151 ·
维护者通常 2 天内回复
-
S3: friction & debt ws:emitter ws:wasm
难度 2/5 1-3 小时 新手友好度 78/100
MedakaLang/medaka#4913 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
bug genc
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复