aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/reflectdata
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-11-05 20:32:38 -0800
committerGopher Robot <gobot@golang.org>2025-11-12 10:03:49 -0800
commite0807ba470e6cfdc6dbc285a76216fab20cb0589 (patch)
treefb6017a173b3e5269406082cda3ee9e7989a57c7 /src/cmd/compile/internal/reflectdata
parent66318d2b4be8e630e16227e175c2c23c05c4398f (diff)
downloadgo-e0807ba470e6cfdc6dbc285a76216fab20cb0589.tar.xz
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata')
-rw-r--r--src/cmd/compile/internal/reflectdata/reflect.go1
1 files changed, 0 insertions, 1 deletions
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
}