aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/slice.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-02 17:14:25 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-08 04:18:04 +0000
commit08dd4ad7e30313d089793f19baff1855bbaa004e (patch)
tree70e5c0c94a50b66c15ac3b261d347c374c870c57 /src/runtime/slice.go
parent8e121b1587bd921ea84c7da49cab3f48dc6b8f36 (diff)
downloadgo-08dd4ad7e30313d089793f19baff1855bbaa004e.tar.gz
go-08dd4ad7e30313d089793f19baff1855bbaa004e.zip
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>
Diffstat (limited to 'src/runtime/slice.go')
-rw-r--r--src/runtime/slice.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/slice.go b/src/runtime/slice.go
index 9ad814a555..52353ea151 100644
--- a/src/runtime/slice.go
+++ b/src/runtime/slice.go
@@ -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)