Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz: adds unaligned global f32 case #2040

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions internal/integration_test/fuzzcases/fuzzcases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -986,3 +986,15 @@ func Test2037(t *testing.T) {
require.Equal(t, []uint64{0x0, 0x0, 0xbbbbbbbbbbbbbbbb, 0xbbbbbbbbbbbbbbbb, 0xcb6151c8d497b060, 0xbbbbbbbbbbbbbbbb, 0xe71c3971a22b233b, 0xa0a0a0a0a0a0a0a, 0x0, 0xfffffffb00000030, 0x0, 0x6c6cbbbbbbbbbbbb, 0xfeb44590ef194fa2, 0x1313131313131313, 0x1898a98e9daf4f22, 0xf8f8f8f80a0a0aa0, 0x6c6c6c6c6c6cf1f8, 0x6c6c6c6c6c6c6c6c, 0x9abbbbbbbbbbbb6c, 0x9a9ad39a9a9a9a9a}, res)
})
}

func Test2040(t *testing.T) {
if !platform.CompilerSupported() {
return
}
run(t, func(t *testing.T, r wazero.Runtime) {
mod, err := r.Instantiate(ctx, getWasmBinary(t, "2040"))
require.NoError(t, err)
_, err = mod.ExportedFunction("").Call(ctx, make([]uint64, 1)...)
require.NoError(t, err)
})
}
Binary file not shown.
21 changes: 21 additions & 0 deletions internal/integration_test/fuzzcases/testdata/2040.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(module
(type (;0;) (func (param i32)))
(func (;0;) (type 0) (param i32)
i32.const 988345840
f32.convert_i32_s
global.get 0 ;;f32.const 0x1.c8c8c8p+73
f32.max
f32.const nan (;=nan;)
i32.const 1
select
i32.reinterpret_f32
i32.const 0 ;; global.get 1
i32.xor
global.set 2) ;; global.set 1 makes no difference
(global (;0;) f32 (f32.const 0x1.c8c8c8p+73 (;=1.68524e+22;)))
(global (;1;) (mut i32) (i32.const 0))
(global (;2;) (mut i32) (i32.const 1000))
(export "" (func 0))
(export "1" (global 0))
(export "2" (global 1))
(data (;0;) ""))
Loading