diff options
author | Matthew Dempsky <mdempsky@google.com> | 2019-04-01 14:01:58 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2019-04-02 18:00:32 +0000 |
commit | 131eb8fbf80fd8b51ae8b5c5220d566582a41e71 (patch) | |
tree | 7a3f7751dccc028633d8b32abc2c743c04412f25 /test/escape_array.go | |
parent | e29f74efb90b8a7f20fd4ffce4038c824c173f50 (diff) | |
download | go-131eb8fbf80fd8b51ae8b5c5220d566582a41e71.tar.gz go-131eb8fbf80fd8b51ae8b5c5220d566582a41e71.zip |
cmd/compile: trim more unnecessary escape analysis messages
"leaking closure reference" is redundant for similar reasons as "&x
escapes to heap" for OADDR nodes: the reference itself does not
allocate, and we already report when the referenced variable is moved
to heap.
"mark escaped content" is redundant with "leaking param content".
Updates #23109.
Change-Id: I1ab599cb1e8434f1918dd80596a70cba7dc8a0cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/170321
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'test/escape_array.go')
-rw-r--r-- | test/escape_array.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/escape_array.go b/test/escape_array.go index 231186ca1f..d363b98eac 100644 --- a/test/escape_array.go +++ b/test/escape_array.go @@ -26,7 +26,7 @@ func bff(a, b *string) U { // ERROR "leaking param: a to result ~r2 level=0$" "l func tbff1() *string { a := "cat" - b := "dog" // ERROR "moved to heap: b$" + b := "dog" // ERROR "moved to heap: b$" u := bff(&a, &b) _ = u[0] return &b @@ -34,8 +34,8 @@ func tbff1() *string { // BAD: need fine-grained analysis to track u[0] and u[1] differently. func tbff2() *string { - a := "cat" // ERROR "moved to heap: a$" - b := "dog" // ERROR "moved to heap: b$" + a := "cat" // ERROR "moved to heap: a$" + b := "dog" // ERROR "moved to heap: b$" u := bff(&a, &b) _ = u[0] return u[1] @@ -71,7 +71,7 @@ func fuo(x *U, y *U) *string { // ERROR "leaking param: x to result ~r2 level=1$ // pointers stored in small array literals do not escape; // large array literals are heap allocated; // pointers stored in large array literals escape. -func hugeLeaks1(x **string, y **string) { // ERROR "leaking param content: x" "hugeLeaks1 y does not escape" "mark escaped content: x" +func hugeLeaks1(x **string, y **string) { // ERROR "leaking param content: x" "hugeLeaks1 y does not escape" a := [10]*string{*y} _ = a // 4 x 4,000,000 exceeds MaxStackVarSize, therefore it must be heap allocated if pointers are 4 bytes or larger. |