From: Keith Randall Date: Thu, 3 Mar 2016 04:54:41 +0000 (-0800) Subject: cmd/compile: fix fieldtrack experiment X-Git-Tag: go1.7beta1~1582 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=71d13a8c01706c0196a843116d403fe8eb446130;p=gostls13.git cmd/compile: fix fieldtrack experiment The ODOTPTRs introduced in CL #19814 don't have field names, just offsets. The fieldtrack experiment crashes when examining them. Instead, just ignore them. We'll never track these fields anyway. It would be nice to have the runtime type struct build in the compiler (like we do sudog, for example) so we could use its fieldnames. Doesn't seem worth it just for this CL. Change-Id: I5e75024f5a8333eb7439543b3f466ea40213a1b9 Reviewed-on: https://go-review.googlesource.com/20157 Reviewed-by: Ian Lance Taylor Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 2abc8df43c..dba8ad3fde 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -3763,6 +3763,11 @@ func usefield(n *Node) { case ODOT, ODOTPTR: break } + if n.Right == nil { + // No field name. This DOTPTR was built by the compiler for access + // to runtime data structures. Ignore. + return + } t := n.Left.Type if Isptr[t.Etype] {