diff options
author | Matthew Dempsky <mdempsky@google.com> | 2019-04-17 11:23:53 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2019-04-17 19:09:15 +0000 |
commit | 9dce58d30d1005e0cbac40789429cd3543d80836 (patch) | |
tree | ed5d8f5debbfeb54caab67341a84b731a404f6b6 /test/escape_runtime_atomic.go | |
parent | e5986209e082cd207989d7f8759ba92e3f9dd8cb (diff) | |
download | go-9dce58d30d1005e0cbac40789429cd3543d80836.tar.gz go-9dce58d30d1005e0cbac40789429cd3543d80836.zip |
runtime/internal/atomic: remove bad go:noescape annotations on Loadp
The //go:noescape directive says that arguments don't leak at all,
which is too aggressive of a claim for functions that return pointers
derived from their parameters.
Remove the directive for now. Long term fix will require a new
directive that allows more fine-grained control over escape analysis
information supplied for functions implemented in assembly.
Also, update the BAD comments in the test cases for Loadp: we really
want that *ptr leaks to the result parameter, not that *ptr leaks to
the heap.
Updates #31525.
Change-Id: Ibfa61f2b70daa7ed3223056b57eeee777eef2e31
Reviewed-on: https://go-review.googlesource.com/c/go/+/172578
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'test/escape_runtime_atomic.go')
-rw-r--r-- | test/escape_runtime_atomic.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/escape_runtime_atomic.go b/test/escape_runtime_atomic.go index 6dfd4aa211..efe2013fb9 100644 --- a/test/escape_runtime_atomic.go +++ b/test/escape_runtime_atomic.go @@ -13,8 +13,8 @@ import ( "unsafe" ) -// BAD: should be "leaking param content". -func Loadp(addr unsafe.Pointer) unsafe.Pointer { // ERROR "leaking param: addr" +// BAD: should always be "leaking param: addr to result ~r1 level=1$". +func Loadp(addr unsafe.Pointer) unsafe.Pointer { // ERROR "leaking param: addr( to result ~r1 level=1)?$" return atomic.Loadp(addr) } |