The Wasm 1.0 execution rule for memory.grow succeeds only if the resulting memory size is no greater than 2^16 pages.
The official WebAssembly Specification, Release 1.0 PDF states:
“If len is larger than 2¹⁶, then fail.”
growmem includes:
Currently the spectec rule is:
def $growmemory(mi, n) = mi'
-- if mi = { TYPE `[i .. j?], BYTES b* }
-- if i' = $(|b*| / (64 * $Ki) + n)
-- if mi' = { TYPE `[i' .. j?], BYTES b* 0^(n * $($(64 * $Ki))) }
-- (if i' <= j)?
It is missing the condition -- if $(i' <= 65536)
The Wasm 1.0 execution rule for
memory.growsucceeds only if the resulting memory size is no greater than2^16pages.The official WebAssembly Specification, Release 1.0 PDF states:
growmemincludes:Currently the spectec rule is:
It is missing the condition
-- if $(i' <= 65536)