Skip to content

Commit 0091a3e

Browse files
authored
Merge branch 'golang:master' into feature/VMkernel-support
2 parents e786a00 + c77ada1 commit 0091a3e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/cmd/compile/internal/ssa/writebarrier.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -637,17 +637,12 @@ func (f *Func) computeZeroMap(select1 []*Value) map[ID]ZeroRegion {
637637
size += ptrSize - d
638638
}
639639
// Clip to the 64 words that we track.
640-
min := off
641-
max := off + size
642-
if min < 0 {
643-
min = 0
644-
}
645-
if max > 64*ptrSize {
646-
max = 64 * ptrSize
647-
}
640+
minimum := max(off, 0)
641+
maximum := min(off+size, 64*ptrSize)
642+
648643
// Clear bits for parts that we are writing (and hence
649644
// will no longer necessarily be zero).
650-
for i := min; i < max; i += ptrSize {
645+
for i := minimum; i < maximum; i += ptrSize {
651646
bit := i / ptrSize
652647
z.mask &^= 1 << uint(bit)
653648
}

0 commit comments

Comments
 (0)