mirror of
https://github.com/golang/go.git
synced 2025-05-09 09:33:03 +00:00
cmd/compile: avoid nil pointer deref in debugging output
Found while tracking down another issue. Change-Id: If06eee72ce3e3f45dc00b3b68670e1e4d99c87a7 Reviewed-on: https://go-review.googlesource.com/116455 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
db49f76dc5
commit
409a943f69
@ -1599,7 +1599,7 @@ func (n *Node) nodedump(s fmt.State, flag FmtFlag, mode fmtMode) {
|
|||||||
|
|
||||||
case OTYPE:
|
case OTYPE:
|
||||||
mode.Fprintf(s, "%v %v%j type=%v", n.Op, n.Sym, n, n.Type)
|
mode.Fprintf(s, "%v %v%j type=%v", n.Op, n.Sym, n, n.Type)
|
||||||
if recur && n.Type == nil && n.Name.Param.Ntype != nil {
|
if recur && n.Type == nil && n.Name != nil && n.Name.Param != nil && n.Name.Param.Ntype != nil {
|
||||||
indent(s)
|
indent(s)
|
||||||
mode.Fprintf(s, "%v-ntype%v", n.Op, n.Name.Param.Ntype)
|
mode.Fprintf(s, "%v-ntype%v", n.Op, n.Name.Param.Ntype)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user