Are indices in the name section expected to be valid up front?

Aperta
#12 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
wasm
Ambito
compilers

Direzione di ricerca

Start with the name-section tests referenced from #11 and review how SpiderMonkey parses name sections, especially before a function body is fully parsed. Compare the current tests with the specification's wording, then establish whether out-of-bounds indices are accepted and update the tests to reflect the decided rule.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In #11 I added tests for the name section that assert things like "invalid type index 123" or "invalid label index 123 for function 1". This seemed reasonable until I went to implement it in SpiderMonkey and remembered that we have no idea how many labels a function has without parsing the full body of the function, which we do quite lazily and in parallel, which is very inconvenient for name section validation.

In principle, we don't actually need to validate all the indices in the name section. If extra names are present that don't correspond to any actual items in the module, that doesn't really hurt anyone (except perhaps the user downloading the oversize module, but they had to anyway because it's a custom section). The spec doesn't actually say today whether the indices in the name section are expected to be valid, only that the name subsections themselves are well-formed.

Basically my question is: should we just delete these valid-index tests across the board / flip them to asserting validity, or should we keep them? My preference would be to flip them all to asserting that out-of-bounds indexes are actually valid.

Lingua principale
WebAssembly
Stelle
12
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/extended-name-section

Tutte le issue di WebAssembly/extended-name-section

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.