Binary reader rebuilds tag types from Signature, dropping rec group and supertype (follow-up to #7219)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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/
- Lingua principale
- WebAssembly
- Stelle
- 8.7k
- Fork
- 905
- Merge medio
- 1g 23h
- PR unite (30g)
- 86
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/binaryen
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
WebAssembly/binaryen#9135 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 76/100
WebAssembly/binaryen#9018 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
WebAssembly/binaryen#9366 ·
I maintainer di solito rispondono entro 1 giorno
-
Add a pass to relax nullabilities of definitionsForse già presa @stevenfontanella l’ha presa 2 giorni fa. Aperta
WebAssembly/binaryen#9352 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
WebAssembly/binaryen#9307 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WebAssembly/binaryen
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
tree-sitter/tree-sitter-cpp#381 ·
-
[P2] Interpreter: Array.prototype.findLastIndex starts at the wrong index for long array-likesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
new issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
llvm/llvm-project#240065 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
CanadaHonk/porffor#452 ·