Allow reference types as long as not used by the initialization function?
还没有人认领这个 Issue。
评估
调研方向
从 issue 中所示的 wasm_reference_types 和 reference_types 配置附近的 src/lib.rs 开始,然后跟踪初始化函数是如何进行验证的。将完成定义为允许模块中使用引用类型,但仅在初始化使用这些类型时报告错误,并验证初始化以及之后的模块使用情况。
由索引模型根据 Issue 内容生成。
描述
I have a WASM module that uses reference types, but the initialization function (some pure precomputation) doesn't use them. Currently, wizer categorically fails with
Error: reference types support is not enabled (at offset 0x31ef)
However, when I apply this patch
diff --git a/src/lib.rs b/src/lib.rs
index f2ceb94..7f5adc9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -623,7 +623,7 @@ impl Wizer {
config.wasm_simd(self.wasm_simd.unwrap_or(DEFAULT_WASM_SIMD));
// Proposals that we should add support for.
- config.wasm_reference_types(false);
+ config.wasm_reference_types(true);
config.wasm_threads(false);
Ok(config)
@@ -642,7 +642,7 @@ impl Wizer {
multi_value: self.wasm_multi_value.unwrap_or(DEFAULT_WASM_MULTI_VALUE),
// Proposals that we should add support for.
- reference_types: false,
+ reference_types: true,
simd: self.wasm_simd.unwrap_or(DEFAULT_WASM_SIMD),
threads: false,
tail_call: false,
everything works fine, both initialization and later usage of the WASM module (including reference types).
Would it make sense to allow reference types a priori, and instead error when instructions related to reference types are encountered during initialization? I could take a stab at a PR if this makes sense.
- 主要语言
- Rust
- 星标
- 1.1k
- 派生
- 64
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/wizer 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
bytecodealliance/wizer#130 ·
-
难度 5/5 一周以上 新手友好度 30/100
bytecodealliance/wizer#153 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
bytecodealliance/wizer#126 ·
-
难度 4/5 3-5 天 新手友好度 25/100
bytecodealliance/wizer#125 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 32/100
bytecodealliance/wizer#105 · 1 条评论 ·
查看 bytecodealliance/wizer 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 68/100
trezor/trezor-firmware#7997 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
smol-machines/smolvm#1489 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复