amd64: fixes memory.fill bug (#1055)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io> Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/tetratelabs/wazero"
|
||||
"github.com/tetratelabs/wazero/api"
|
||||
"github.com/tetratelabs/wazero/internal/platform"
|
||||
"github.com/tetratelabs/wazero/internal/testing/require"
|
||||
"github.com/tetratelabs/wazero/internal/wasm"
|
||||
@@ -383,3 +384,22 @@ func Test888(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func Test1054(t *testing.T) {
|
||||
if !platform.CompilerSupported() {
|
||||
return
|
||||
}
|
||||
|
||||
modules := make([]api.Module, 0, 2)
|
||||
run(t, func(t *testing.T, r wazero.Runtime) {
|
||||
mod, err := r.InstantiateModuleFromBinary(ctx, getWasmBinary(t, 1054))
|
||||
require.NoError(t, err)
|
||||
modules = append(modules, mod)
|
||||
})
|
||||
|
||||
// Checks if the memory state is the same between engines.
|
||||
require.Equal(t,
|
||||
modules[0].Memory().(*wasm.MemoryInstance).Buffer,
|
||||
modules[1].Memory().(*wasm.MemoryInstance).Buffer,
|
||||
)
|
||||
}
|
||||
|
||||
BIN
internal/integration_test/fuzzcases/testdata/1054.wasm
vendored
Normal file
BIN
internal/integration_test/fuzzcases/testdata/1054.wasm
vendored
Normal file
Binary file not shown.
11
internal/integration_test/fuzzcases/testdata/1054.wat
vendored
Normal file
11
internal/integration_test/fuzzcases/testdata/1054.wat
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
(module
|
||||
(type (;0;) (func))
|
||||
(func (;0;) (type 0)
|
||||
i32.const 1000
|
||||
i32.const 1000
|
||||
i32.const 1000
|
||||
memory.fill
|
||||
)
|
||||
(memory (;0;) 1 2)
|
||||
(start 0)
|
||||
)
|
||||
Reference in New Issue
Block a user