Commit 71d13a8c authored by Keith Randall's avatar Keith Randall

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/20157Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 868fb9ff
...@@ -3763,6 +3763,11 @@ func usefield(n *Node) { ...@@ -3763,6 +3763,11 @@ func usefield(n *Node) {
case ODOT, ODOTPTR: case ODOT, ODOTPTR:
break 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 t := n.Left.Type
if Isptr[t.Etype] { if Isptr[t.Etype] {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment