all: fix most of the remaining windows -d=checkptr violations
This change replaces buf := [HUGE_CONST]*T)(unsafe.Pointer(p))[:] with buf := [HUGE_CONST]*T)(unsafe.Pointer(p))[:n:n] Pointer p points to n of T elements. New unsafe pointer conversion logic verifies that both first and last elements point into the same Go variable. This change replaces [:] with [:n:n] to please pointer checker. According to @mdempsky, compiler specially recognizes when you combine a pointer conversion with a full slice operation in a single expression and makes an exception. After this, only one failure in net remains when running: go test -a -short -gcflags=all=-d=checkptr std cmd Updates #34972 Change-Id: I2c8731650c856264bc788e4e07fa0530f7c250fa Reviewed-on: https://go-review.googlesource.com/c/go/+/208617 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Showing
Please register or sign in to comment