mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
86f1944e86
commit
1babba2e4c
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
13
src/runtime/race/testdata/issue13264_test.go
vendored
Normal file
13
src/runtime/race/testdata/issue13264_test.go
vendored
Normal file
|
|
@ -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 {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue