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

wip #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

wip #45

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
2 changes: 1 addition & 1 deletion internal/engine/wazevo/wazevoapi/debug_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
PrintRegisterAllocated = false
PrintFinalizedMachineCode = false
PrintMachineCodeHexPerFunction = printMachineCodeHexPerFunctionUnmodified || PrintMachineCodeHexPerFunctionDisassemblable //nolint
printMachineCodeHexPerFunctionUnmodified = false
printMachineCodeHexPerFunctionUnmodified = true
// PrintMachineCodeHexPerFunctionDisassemblable prints the machine code while modifying the actual result
// to make it disassemblable. This is useful when debugging the final machine code. See the places where this is used for detail.
// When this is enabled, functions must not be called.
Expand Down
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