From: Michael Munday Date: Fri, 11 Mar 2016 15:21:51 +0000 (-0500) Subject: cmd/internal/obj: fix nil pointer dereference in Dconv X-Git-Tag: go1.7beta1~1394 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d05773ce73ae5ed784dc47800992f58790023b4a;p=gostls13.git cmd/internal/obj: fix nil pointer dereference in Dconv p can be nil in Dconv so we need to do a check before dereferencing it. Fixes a problem I was having running toolstash. Change-Id: I34d6d278b319583d8454c2342ac88e054fc4b641 Reviewed-on: https://go-review.googlesource.com/20595 Reviewed-by: David Crawshaw Run-TryBot: David Crawshaw TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 7b70d3c584..4c37f76ca9 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -406,7 +406,7 @@ func Dconv(p *Prog, a *Addr) string { if a.Index != REG_NONE { str += fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale)) } - if p.As == ATYPE && a.Gotype != nil { + if p != nil && p.As == ATYPE && a.Gotype != nil { str += fmt.Sprintf("%s", a.Gotype.Name) }