From: Matthew Dempsky Date: Wed, 7 Sep 2022 09:04:13 +0000 (-0700) Subject: test: fix typo in escape_unsafe.go X-Git-Tag: go1.20rc1~1133 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2c45feb4d7b8d214d10ca7a34f0986b4e3d00ca1;p=gostls13.git 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 Run-TryBot: Matthew Dempsky TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek --- 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) }