mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: only check for pointers up to ptrdata, not size
Change-Id: I166cf253b7f2483d652c98d2fba36c380e2f3347 Reviewed-on: https://go-review.googlesource.com/c/go/+/227177 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
8e121b1587
commit
08dd4ad7e3
2 changed files with 21 additions and 5 deletions
|
|
@ -182,7 +182,7 @@ func growslice(et *_type, old slice, cap int) slice {
|
|||
if lenmem > 0 && writeBarrier.enabled {
|
||||
// Only shade the pointers in old.array since we know the destination slice p
|
||||
// only contains nil pointers because it has been cleared during alloc.
|
||||
bulkBarrierPreWriteSrcOnly(uintptr(p), uintptr(old.array), lenmem)
|
||||
bulkBarrierPreWriteSrcOnly(uintptr(p), uintptr(old.array), lenmem-et.size+et.ptrdata)
|
||||
}
|
||||
}
|
||||
memmove(p, old.array, lenmem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue