summaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-06-28 14:19:27 -0700
committerIan Lance Taylor <iant@golang.org>2016-07-06 20:48:41 +0000
commitbbe5da42600d5ab26cd58ffac3d6427994f08fb2 (patch)
tree5b78e647cf80941548cf767021e96e2ae3fcf2bd /src/syscall
parent820e30f5b0289d5df22ab604f2d831470f748dca (diff)
downloadgo-git-bbe5da42600d5ab26cd58ffac3d6427994f08fb2.tar.gz
cmd/compile, syscall: add //go:uintptrescapes comment, and use it
This new comment can be used to declare that the uintptr arguments to a function may be converted from pointers, and that those pointers should be considered to escape. This is used for the Call methods in dll_windows.go that take uintptr arguments, because they call Syscall. We can't treat these functions as we do syscall.Syscall, because unlike Syscall they may cause the stack to grow. For Syscall we can assume that stack arguments can remain on the stack, but for these functions we need them to escape. Fixes #16035. Change-Id: Ia0e5b4068c04f8d303d95ab9ea394939f1f57454 Reviewed-on: https://go-review.googlesource.com/24551 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/dll_windows.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/syscall/dll_windows.go b/src/syscall/dll_windows.go
index 944571c3b0..e5638480b7 100644
--- a/src/syscall/dll_windows.go
+++ b/src/syscall/dll_windows.go
@@ -130,6 +130,8 @@ func (p *Proc) Addr() uintptr {
return p.addr
}
+//go:uintptrescapes
+
// Call executes procedure p with arguments a. It will panic, if more than 15 arguments
// are supplied.
//
@@ -288,6 +290,8 @@ func (p *LazyProc) Addr() uintptr {
return p.proc.Addr()
}
+//go:uintptrescapes
+
// Call executes procedure p with arguments a. It will panic, if more than 15 arguments
// are supplied.
//