From f68d1df6b987ce7d0e33bb836670c92ad66f65dd Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 17 Aug 2015 21:38:46 -0400 Subject: [PATCH] cmd/compile: fix interaction between GOEXPERIMENT=fieldtrack and race detector Tested by hand. Only lines of code changing are protected by Fieldtrack_enabled > 0, which is never true in standard Go distributions. Fixes #12171. Change-Id: I963b9997dac10829db8ad4bfc97a7d6bf14b55c6 Reviewed-on: https://go-review.googlesource.com/13676 Reviewed-by: Ian Lance Taylor --- src/cmd/compile/internal/gc/typecheck.go | 2 +- src/cmd/compile/internal/gc/walk.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index dc2ba75e69b..befe3b26523 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -2532,7 +2532,7 @@ func lookdot(n *Node, t *Type, dostrcmp int) *Type { n.Xoffset = f1.Width n.Type = f1.Type if obj.Fieldtrack_enabled > 0 { - dotField[typeSym{t, s}] = f1 + dotField[typeSym{t.Orig, s}] = f1 } if t.Etype == TINTER { if Isptr[n.Left.Type.Etype] { diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 91c0a47b2ae..ce73018b8b0 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -3873,7 +3873,7 @@ func usefield(n *Node) { if Isptr[t.Etype] { t = t.Type } - field := dotField[typeSym{t, n.Right.Sym}] + field := dotField[typeSym{t.Orig, n.Right.Sym}] if field == nil { Fatal("usefield %v %v without paramfld", n.Left.Type, n.Right.Sym) }