You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A WASM module that imports a table with a minimum size can only be instantiated with an imported table that was created with a compatible table type. Importing a table that was created with a lower minimum size and resized using Table::grow to a compatible size results in an error incompatible import type.
The issue is that Wasmer currently changes the minimum when calling table.grow (it shouldn't be the case) (if we do table.grow(10) the minimum goes from x to x+10 at the moment).
Describe the bug
A WASM module that imports a table with a minimum size can only be instantiated with an imported table that was created with a compatible table type. Importing a table that was created with a lower minimum size and resized using
Table::grow
to a compatible size results in an errorincompatible import type
.Observed using Wasmer 2.3.0 and 3.0.0-beta.
Steps to reproduce
Using Wasmer 3.0.0-beta:
Expected behavior
After calling
table.grow
the size oftable
is compatible with the WASM import declaration, and the instance is created.Actual behavior
Error while importing
"env"."table"
: incompatible import type. ExpectedTable(TableType { ty: FuncRef, minimum: 100, maximum: None })
but receivedTable(TableType { ty: FuncRef, minimum: 0, maximum: None })
.Additional context
The WASM specification states that the limits of the table limits must match (https://www.w3.org/TR/wasm-core-2/valid/types.html#tables), and the minimum limit is updated when growing a table (https://www.w3.org/TR/wasm-core-2/exec/modules.html#grow-table).
In
wasmtime
and Javascript in Firefox/Chrome/V8 the instantiation is successful in the corresponding code:Javascript (works)
Wasmtime 1.0.0 (works)
Wasmer 2.3.0 (fails)
The text was updated successfully, but these errors were encountered: