Skip to content
Open
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 src/crypto/rand/rand_arc4random.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type reader struct {

func (r *reader) Read(b []byte) (n int, err error) {
if len(b) != 0 {
libc_arc4random_buf(unsafe.Pointer(&b[0]), uint(len(b)))
libc_arc4random_buf(unsafe.Pointer(unsafe.SliceData(b)), uint(len(b)))
}
return len(b), nil
}
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/rand/rand_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (r *reader) Read(b []byte) (n int, err error) {
// See for example: https://github.com/golang/go/issues/33542
// For Windows 7 and newer, we might switch to ProcessPrng in the future
// (which is a documented function and might be a tiny bit faster).
ok := libc_RtlGenRandom(unsafe.Pointer(&b[0]), len(b))
ok := libc_RtlGenRandom(unsafe.Pointer(unsafe.SliceData(b)), len(b))
if !ok {
return 0, errRandom
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal/syscall/unix/getrandom_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func GetRandom(p []byte, flags GetRandomFlag) (n int, err error) {
if len(p) == 0 {
return 0, nil
}
libc_arc4random_buf(unsafe.Pointer(&p[0]), uint(len(p)))
libc_arc4random_buf(unsafe.Pointer(unsafe.SliceData(p)), uint(len(p)))
return len(p), nil
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/osexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func execve(pathname string, argv []string, envv []string) error {
}
env1[len(envv)] = nil

ret, _, err := syscall.Syscall(syscall.SYS_EXECVE, uintptr(unsafe.Pointer(&argv0[0])), uintptr(unsafe.Pointer(&argv1[0])), uintptr(unsafe.Pointer(&env1[0])))
ret, _, err := syscall.Syscall(syscall.SYS_EXECVE, uintptr(unsafe.Pointer(unsafe.SliceData(argv0))), uintptr(unsafe.Pointer(unsafe.SliceData(argv1))), uintptr(unsafe.Pointer(unsafe.SliceData(env1))))
if int(ret) != 0 {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_tinygowasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
putcharBuffer = [putcharBufferSize]byte{}
putcharPosition uint = 0
putcharIOVec = __wasi_iovec_t{
buf: unsafe.Pointer(&putcharBuffer[0]),
buf: unsafe.Pointer(unsafe.SliceData(putcharBuffer[:])),
}
putcharNWritten uint
)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_wasip1.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func os_runtime_args() []string {
// Obtain the command line arguments
argsSlice := make([]unsafe.Pointer, argc)
buf := make([]byte, argv_buf_size)
args_get(&argsSlice[0], unsafe.Pointer(&buf[0]))
args_get(&argsSlice[0], unsafe.Pointer(unsafe.SliceData(buf)))

// Convert the array of C strings to an array of Go strings.
args = make([]string, argc)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func cgo_GoBytes(ptr unsafe.Pointer, length uintptr) []byte {
// of upstream Go.
buf := make([]byte, length)
if length != 0 {
memcpy(unsafe.Pointer(&buf[0]), ptr, uintptr(length))
memcpy(unsafe.Pointer(unsafe.SliceData(buf)), ptr, uintptr(length))
}
return buf
}
Expand Down
4 changes: 2 additions & 2 deletions src/syscall/syscall_libc.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
}

func Munmap(b []byte) (err error) {
errCode := libc_munmap(unsafe.Pointer(&b[0]), uintptr(len(b)))
errCode := libc_munmap(unsafe.Pointer(unsafe.SliceData(b)), uintptr(len(b)))
if errCode != 0 {
err = getErrno()
}
return err
}

func Mprotect(b []byte, prot int) (err error) {
errCode := libc_mprotect(unsafe.Pointer(&b[0]), uintptr(len(b)), int32(prot))
errCode := libc_mprotect(unsafe.Pointer(unsafe.SliceData(b)), uintptr(len(b)), int32(prot))
if errCode != 0 {
err = getErrno()
}
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/syscall_libc_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ type RawSockaddrInet6 struct {

func RandomGet(b []byte) error {
if len(b) > 0 {
libc_arc4random_buf(unsafe.Pointer(&b[0]), uint(len(b)))
libc_arc4random_buf(unsafe.Pointer(unsafe.SliceData(b)), uint(len(b)))
}
return nil
}
Expand Down
Loading