From a408501be4d17ee978c04a618e7a1b22af058c0e Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Mon, 4 Jul 2016 08:56:20 +0900 Subject: [PATCH] unix: fix missing use of use function in Getfsstat and Getwd Updates golang/go#13372. Change-Id: I623de97eb19880356148cbcb7d17759df82684aa Reviewed-on: https://go-review.googlesource.com/24751 Run-TryBot: Mikio Hara TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- unix/syscall_darwin.go | 2 ++ unix/syscall_dragonfly.go | 1 + unix/syscall_freebsd.go | 1 + unix/syscall_openbsd.go | 1 + 4 files changed, 5 insertions(+) diff --git a/unix/syscall_darwin.go b/unix/syscall_darwin.go index 0d1771c3..3d534d2d 100644 --- a/unix/syscall_darwin.go +++ b/unix/syscall_darwin.go @@ -144,6 +144,7 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( uintptr(options), 0, ) + use(unsafe.Pointer(_p0)) if e1 != 0 { return nil, e1 } @@ -196,6 +197,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags)) + use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1 diff --git a/unix/syscall_dragonfly.go b/unix/syscall_dragonfly.go index fbbe0dce..ec408ee7 100644 --- a/unix/syscall_dragonfly.go +++ b/unix/syscall_dragonfly.go @@ -109,6 +109,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1 diff --git a/unix/syscall_freebsd.go b/unix/syscall_freebsd.go index ec56ed60..520ccbea 100644 --- a/unix/syscall_freebsd.go +++ b/unix/syscall_freebsd.go @@ -129,6 +129,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1 diff --git a/unix/syscall_openbsd.go b/unix/syscall_openbsd.go index 246131d2..554a8234 100644 --- a/unix/syscall_openbsd.go +++ b/unix/syscall_openbsd.go @@ -111,6 +111,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1