From: Ian Lance Taylor Date: Thu, 6 Nov 2025 04:32:38 +0000 (-0800) Subject: cmd/compile: don't clear ptrmask in fillptrmask X-Git-Tag: go1.26rc1~312 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e0807ba470;p=gostls13.git cmd/compile: don't clear ptrmask in fillptrmask It is only ever called with a newly allocated slice. This clearing code dates back to the C version of the compiler, in which the function started like this: static void gengcmask(Type *t, uint8 gcmask[16]) { ... memset(gcmask, 0, 16); if(!haspointers(t)) return; That memset was required for C, but not for Go. Change-Id: I6fceb99b2dc8682685dca2e4289fcd58e2e5a0e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/718340 LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Auto-Submit: Ian Lance Taylor Reviewed-by: Keith Randall Reviewed-by: Junyang Shao --- diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 38b9391c5f..324007ea79 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -1282,7 +1282,6 @@ func dgcptrmask(t *types.Type, write bool) *obj.LSym { // word offsets in t that hold pointers. // ptrmask is assumed to fit at least types.PtrDataSize(t)/PtrSize bits. func fillptrmask(t *types.Type, ptrmask []byte) { - clear(ptrmask) if !t.HasPointers() { return }