WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.11k stars 439 forks source link

[wasm-js-api-2] js-api Memory.grow requirement cannot be fulfilled via the core specification #1635

Open alimpfard opened 1 year ago

alimpfard commented 1 year ago

A requirement appearing after Memory.grow(delta) asks the host to execute code after an instruction completes:

Immediately after a WebAssembly memory.grow instruction executes, perform the following steps: [...]

There are no notes about this in the core spec, and a correct implementation of the core spec lacks APIs for this sort of hook. While a hook can be placed in the memory store's grow implementation, this requirement cannot be fulfilled as-is.

For reference, memory.grow does not provide any such hooks.