Binary reader rebuilds tag types from Signature, dropping rec group and supertype (follow-up to #7219)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Read readTagImport at src/wasm/wasm-binary.cpp:3303 and readTags at src/wasm/wasm-binary.cpp:5522, where the issue says tag types are obtained through getSignatureByTypeIndex(...) instead of getTypeByIndex(...). Use the supplied WAT examples and wasm-opt commands to reproduce and compare text and binary round trips. Done when binary reading preserves the declared recursive group type and the reproduced tag import links successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When a tag's type is part of a rec group, reading the module from a binary gives the tag a fresh canonical (func) type. The text reader keeps the declared type. After a binary round trip through wasm-opt, the tag no longer links against importers that use the original type. #7220 fixed Tag::type and the writer, but the reader still goes through Signature.
;; exp.wat
(module
(rec (type $t1 (func)) (type $t2 (func)))
(tag (export "x") (type $t1)))
wasm-opt --all-features exp.wat -o exp.wasm
wasm-opt --all-features --emit-text exp.wat -o -
wasm-opt --all-features --emit-text exp.wasm -o -
From the .wat:
(module
(rec
(type $t1 (func))
(type $t2 (func))
)
(tag $tag$0 (type $t1))
(export "x" (tag $tag$0))
)
From the .wasm:
(module
(type $0 (func))
(tag $tag$0 (type $0))
(export "x" (tag $tag$0))
)
Linking: with imp.wat = (module (rec (type $t1 (func)) (type $t2 (func))) (tag (import "m" "x") (type $t1))), instantiating imp.wasm with the tag exported by exp.wasm works in Node v26.13.0, but with the tag from wasm-opt --all-features exp.wasm -o out.wasm it fails:
WebAssembly.Instance(): Import #0 "m" "x": imported tag does not match the expected type
Tested with wasm-opt version 133 (version_133). On main (95a214d) the reader code is the same: readTagImport (src/wasm/wasm-binary.cpp:3303) and readTags (:5522) pass getSignatureByTypeIndex(...) to makeTag instead of the HeapType from getTypeByIndex(...).
Credit: https://ucsbplse.github.io/
- Ngôn ngữ chính
- WebAssembly
- Star
- 8.7k
- Fork
- 905
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 86
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WebAssembly/binaryen
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
WebAssembly/binaryen#9135 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
WebAssembly/binaryen#9018 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
WebAssembly/binaryen#9366 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a pass to relax nullabilities of definitionsCó thể đã có người làm @stevenfontanella đã nhận 2 ngày trước. Đang mở
WebAssembly/binaryen#9352 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
WebAssembly/binaryen#9307 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của WebAssembly/binaryen
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
tree-sitter/tree-sitter-cpp#381 ·
-
[P2] Interpreter: Array.prototype.findLastIndex starts at the wrong index for long array-likesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
llvm/llvm-project#240065 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
CanadaHonk/porffor#452 ·