aboutsummaryrefslogtreecommitdiff
path: root/test/escape_unsafe.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-09-07 02:04:13 -0700
committerMatthew Dempsky <mdempsky@google.com>2022-09-07 17:25:59 +0000
commit2c45feb4d7b8d214d10ca7a34f0986b4e3d00ca1 (patch)
tree942d31abca88ce25d013d399c74776c0846412c8 /test/escape_unsafe.go
parentcdb270cf0737a4752e5375b737eba83929f2b415 (diff)
downloadgo-2c45feb4d7b8d214d10ca7a34f0986b4e3d00ca1.tar.gz
go-2c45feb4d7b8d214d10ca7a34f0986b4e3d00ca1.zip
test: fix typo in escape_unsafe.go
The toStringData test was meant to test reflect.StringHeader, not reflect.SliceHeader. It's not supported to convert *string to *reflect.SliceHeader anyway. Change-Id: Iaa4912eafd241886c6337bd7607cdf2412a15ead Reviewed-on: https://go-review.googlesource.com/c/go/+/428995 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'test/escape_unsafe.go')
-rw-r--r--test/escape_unsafe.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/escape_unsafe.go b/test/escape_unsafe.go
index cec6674a14..56c536fdfb 100644
--- a/test/escape_unsafe.go
+++ b/test/escape_unsafe.go
@@ -65,5 +65,5 @@ func toSliceData(s *[]int, p unsafe.Pointer) { // ERROR "s does not escape" "lea
}
func toStringData(s *string, p unsafe.Pointer) { // ERROR "s does not escape" "leaking param: p$"
- (*reflect.SliceHeader)(unsafe.Pointer(s)).Data = uintptr(p)
+ (*reflect.StringHeader)(unsafe.Pointer(s)).Data = uintptr(p)
}