[interpreter] Binary decoder rejects heap type indices >= 2^31 as malformed
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
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- wasm
Direzione di ricerca
Start in interpreter/binary/decode.ml at the s33 decoding path around line 108, then compare how it handles the provided boundary indices 2^31 and 2^31 - 1. Run the interpreter against the included assert_invalid module and check the reported error. Done means 2^31 is decoded as a well-formed index and the module reports "unknown type" rather than "integer representation too long".
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A heap type index is any non-negative s33:
So an index of 2^31 or 2^32 - 1 is well-formed, and a module using it is invalid (unknown type), not malformed. The decoder wraps the s33 to a signed 32-bit integer first and reports "integer representation too long":
;; (type (func (param (ref null 2147483648))))
(assert_invalid
(module binary "\00asm" "\01\00\00\00"
"\01\0a\01\60\01\63\80\80\80\80\08\00")
"unknown type")
The interpreter fails this with integer representation too long. Index 2^31 - 1 (\ff\ff\ff\ff\07) is reported as "unknown type" as expected.
Tested at 340650f.
- Lingua principale
- WebAssembly
- Stelle
- 3.5k
- Fork
- 540
- Merge medio
- 1g 4h
- PR unite (30g)
- 19
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/spec
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
WebAssembly/spec#2287 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
WebAssembly/spec#2285 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
WebAssembly/spec#2284 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
WebAssembly/spec#2281 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
WebAssembly/spec#2288 ·
I maintainer di solito rispondono entro 1 giorno