aboutsummaryrefslogtreecommitdiff
path: root/test/escape5.go
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2021-03-23 16:43:18 +0100
committerFilippo Valsorda <filippo@golang.org>2021-03-23 16:43:18 +0100
commit229a39e347178614d2b5c103cbdc96b7f30a015a (patch)
tree74cd619fe213fe2047d4ae31d8a99cdee9e84208 /test/escape5.go
parent055f1da6e6b96d4de842fd80773dea6d977fc025 (diff)
parentdcffdac515a1d409bcb61783d57ddb137b4741b9 (diff)
downloadgo-229a39e347178614d2b5c103cbdc96b7f30a015a.tar.gz
go-229a39e347178614d2b5c103cbdc96b7f30a015a.zip
[dev.boringcrypto.go1.15] all: merge go1.15.10 into dev.boringcrypto.go1.15
Change-Id: I2ac6b45dbfcfdaf956f2f4b11b60f8d24130141b
Diffstat (limited to 'test/escape5.go')
-rw-r--r--test/escape5.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/escape5.go b/test/escape5.go
index 061e57a069..145c5dd900 100644
--- a/test/escape5.go
+++ b/test/escape5.go
@@ -262,3 +262,14 @@ func f28369(n int) int {
return 1 + f28369(n-1)
}
+
+// Issue 44614: parameters that flow to a heap-allocated result
+// parameter must be recorded as a heap-flow rather than a
+// result-flow.
+
+// N.B., must match "leaking param: p",
+// but *not* "leaking param: p to result r level=0".
+func f(p *int) (r *int) { // ERROR "leaking param: p$" "moved to heap: r"
+ sink4 = &r
+ return p
+}