aboutsummaryrefslogtreecommitdiff
path: root/test/writebarrier.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-05-18 16:54:59 -0400
committerRuss Cox <rsc@golang.org>2015-05-19 15:28:29 +0000
commit366ba526e88f5b523298d3ad5014e04a495add82 (patch)
tree660228090ed5ad2dccd92183ab27ef16b2851e86 /test/writebarrier.go
parentf3fc8b024530c6b67367667455748d9b1f19eafe (diff)
downloadgo-366ba526e88f5b523298d3ad5014e04a495add82.tar.gz
go-366ba526e88f5b523298d3ad5014e04a495add82.zip
cmd/internal/gc: add missing write barrier in append(x, BigStructWithPointers)
Fixes #10897. Change-Id: I5c2d1f9d26333e2b2a0613ebf496daa465e07c24 Reviewed-on: https://go-review.googlesource.com/10221 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'test/writebarrier.go')
-rw-r--r--test/writebarrier.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/writebarrier.go b/test/writebarrier.go
index b24af9a14d..9b741a60df 100644
--- a/test/writebarrier.go
+++ b/test/writebarrier.go
@@ -128,3 +128,19 @@ func f13(x []int, y *[]int) {
func f14(y *[]int) {
*y = append(*y, 1) // ERROR "write barrier"
}
+
+type T1 struct {
+ X *int
+}
+
+func f15(x []T1, y T1) []T1 {
+ return append(x, y) // ERROR "write barrier"
+}
+
+type T8 struct {
+ X [8]*int
+}
+
+func f16(x []T8, y T8) []T8 {
+ return append(x, y) // ERROR "write barrier"
+}