-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
In memory.go:
func (mem *Memory) UnsafeData(store Storelike) []byte {
// see https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
const MaxLen = 1 << 32
length := mem.DataSize(store)
if length >= MaxLen {
panic("memory is too big")
}
return (*[MaxLen]byte)(mem.Data(store))[:length:length]
}
The 1 << 32 results in an overflow because uintptr type is 32bit on 32bit systems.
I suggest replacing it with 0xffffffff instead. That should remove the compilation error.
Metadata
Metadata
Assignees
Labels
No labels