diff --git a/internal/integration_test/vs/runtime.go b/internal/integration_test/vs/runtime.go index 66d36c894b..8964ee4bcb 100644 --- a/internal/integration_test/vs/runtime.go +++ b/internal/integration_test/vs/runtime.go @@ -80,9 +80,9 @@ func (m *wazeroModule) Memory() []byte { } func (r *wazeroRuntime) log(_ context.Context, mod api.Module, stack []uint64) { - offset, byteCount := uint32(stack[0]), stack[1] + offset, byteCount := uint32(stack[0]), uint32(stack[1]) - buf, ok := mod.Memory().Read(offset, byteCount) + buf, ok := mod.Memory().Read(offset, uint64(byteCount)) if !ok { panic("out of memory reading log buffer") } diff --git a/internal/logging/logging.go b/internal/logging/logging.go index 3ec055e050..2e1da2d5fd 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -282,8 +282,8 @@ func writeMemH64(_ context.Context, mod api.Module, w Writer, i uint32, vals []u } func writeString(_ context.Context, mod api.Module, w Writer, i uint32, vals []uint64) { - offset, byteCount := uint32(vals[i]), vals[i+1] - WriteStringOrOOM(mod.Memory(), w, offset, byteCount) + offset, byteCount := uint32(vals[i]), uint32(vals[i+1]) + WriteStringOrOOM(mod.Memory(), w, offset, uint64(byteCount)) } func WriteStringOrOOM(mem api.Memory, w Writer, offset uint32, byteCount uint64) { diff --git a/internal/wasip1/logging/logging.go b/internal/wasip1/logging/logging.go index badc4878f6..7881f5e824 100644 --- a/internal/wasip1/logging/logging.go +++ b/internal/wasip1/logging/logging.go @@ -292,8 +292,8 @@ func (i logFdstat) Log(_ context.Context, mod api.Module, w logging.Writer, para type logString uint32 func (i logString) Log(_ context.Context, mod api.Module, w logging.Writer, params []uint64) { - offset, byteCount := uint32(params[i]), uint64(params[i+1]) - if s, ok := mod.Memory().Read(offset, byteCount); ok { + offset, byteCount := uint32(params[i]), uint32(params[i+1]) + if s, ok := mod.Memory().Read(offset, uint64(byteCount)); ok { w.Write(s) //nolint } }