aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-12-14 13:24:27 -0500
committerRuss Cox <rsc@golang.org>2015-12-16 17:20:26 +0000
commit1babba2e4cf49fce0d6bc00460020d13e94a0c4c (patch)
tree9e30a14600c0130bef88d22282872340003ecc08 /src
parent86f1944e86ae3e07651dcbfafee37f1e3b0a917d (diff)
downloadgo-1babba2e4cf49fce0d6bc00460020d13e94a0c4c.tar.xz
cmd/compile: fix -race nit
Fixes #13264. Change-Id: I74b941164610921a03814733fea08631f18b6178 Reviewed-on: https://go-review.googlesource.com/17815 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/racewalk.go2
-rw-r--r--src/runtime/race/testdata/issue13264_test.go13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/racewalk.go b/src/cmd/compile/internal/gc/racewalk.go
index 35e06b9e7e..ec94042562 100644
--- a/src/cmd/compile/internal/gc/racewalk.go
+++ b/src/cmd/compile/internal/gc/racewalk.go
@@ -151,7 +151,7 @@ func instrumentnode(np **Node, init **NodeList, wr int, skip int) {
for l := n.List; l != nil; l = l.Next {
switch l.N.Op {
case OCALLFUNC, OCALLMETH, OCALLINTER:
- instrumentnode(&l.N, &out, 0, 0)
+ instrumentnode(&l.N, &l.N.Ninit, 0, 0)
out = list(out, l.N)
// Scan past OAS nodes copying results off stack.
// Those must not be instrumented, because the
diff --git a/src/runtime/race/testdata/issue13264_test.go b/src/runtime/race/testdata/issue13264_test.go
new file mode 100644
index 0000000000..d42290de50
--- /dev/null
+++ b/src/runtime/race/testdata/issue13264_test.go
@@ -0,0 +1,13 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package race_test
+
+// golang.org/issue/13264
+// The test is that this compiles at all.
+
+func issue13264() {
+ for ; ; []map[int]int{}[0][0] = 0 {
+ }
+}