WebAssembly / WebAssembly/binaryen
Slow to disassemble some crafted wasm files
未关闭
还没有人认领这个 Issue。
- 主要语言
- WebAssembly
- 星标
- 8.6k
- 派生
- 885
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 69
描述
wasm-dis may sometimes spend too much time to disassemble certain crafted wasm files.
wasm-dis-slow.zip
It turns out that inside WasmBinaryBuilder::readFunctions(), at https://github.com/WebAssembly/binaryen/blob/master/src/wasm/wasm-binary.cpp#L1073-L1080, the value num may get extremely large (I haven't figured out why yet), and subsequent operations require too much time to finish.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从提供的 wasm-dis-slow.zip 开始,检查 src/wasm/wasm-binary.cpp 中大约第 1073–1080 行的 WasmBinaryBuilder::readFunctions(),重点关注值 num 的获取和使用方式。复现缓慢的反汇编,并确定 num 为什么会变得极大。当构造的文件不再导致 wasm-dis 花费过多时间时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp, wasm
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100