Skip to content

Commit e0807ba

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent 66318d2 commit e0807ba

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/cmd/compile/internal/reflectdata/reflect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,6 @@ func dgcptrmask(t *types.Type, write bool) *obj.LSym {
12821282
// word offsets in t that hold pointers.
12831283
// ptrmask is assumed to fit at least types.PtrDataSize(t)/PtrSize bits.
12841284
func fillptrmask(t *types.Type, ptrmask []byte) {
1285-
clear(ptrmask)
12861285
if !t.HasPointers() {
12871286
return
12881287
}

0 commit comments

Comments
 (0)