Clean up FailToEvalExceptions and import stubbing in wasm-ctor.cpp

Abierto
#8,117 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@stevenfontanella ya está trabajando en esto.

Desde el 12/12/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

The way that imports are handled in wasm-ctor.cpp is pretty unclear today. All imports must be present, but typically we raise FailToEvalException when trying to read/write them since we don't know what the import contains at the time that wasm-ctor runs. That much is fine, but the code is inconsistent in how it does this.

  • For tags, getImportedTag throws an unreachable exception.
  • For memories, the tracking table isn't populated during init, so reads and writes to memories will fail saying that the imported memory doesn't exist: link.
  • Functions are stubbed with unreachable (for the 'env' module, and for all modules after #8115).
  • And tables and globals will throw FailToEvalException link.

These all correctly stop evaluation when trying to observe or write to an import, but they all do it in different ways which is confusing. We should clean up the logic here.

Lenguaje dominante
WebAssembly
Estrellas
8.6k
Forks
885
Merge medio
2 d 1 h
PR fusionados (30 d)
70

Guía de contribución

Abrir la guía de contribución

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/binaryen

Todos los issues de WebAssembly/binaryen

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.