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

Abierto
#12 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
wasm
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
WebAssembly
Estrellas
12
Forks
2
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/extended-name-section

Todos los issues de WebAssembly/extended-name-section

Issues similares

Más issues de Compilers

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.