wazevo: fuzz, fix load_splat (#1810)

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Edoardo Vacchi
2023-10-23 09:17:37 +02:00
committed by GitHub
parent 95a240370c
commit 1748dbcfe8
6 changed files with 159 additions and 17 deletions

View File

@@ -610,6 +610,21 @@ func Test1797d(t *testing.T) {
})
}
// Test1802 tests that load32_splat computes the load from the right offset
// when a nonzero value is on the stack.
func Test1802(t *testing.T) {
if !platform.CompilerSupported() {
return
}
run(t, func(t *testing.T, r wazero.Runtime) {
mod, err := r.Instantiate(ctx, getWasmBinary(t, "1802"))
require.NoError(t, err, "wasm binary should build successfully")
m := mod.(*wasm.ModuleInstance)
_, err = m.ExportedFunction("").Call(ctx)
require.Contains(t, err.Error(), "wasm error: unreachable")
})
}
// Test1812 tests that many constant block params work fine.
func Test1812(t *testing.T) {
if !platform.CompilerSupported() {