mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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>
This commit is contained in:
parent
cdb270cf07
commit
2c45feb4d7
@ -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$"
|
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)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user