1
0
mirror of https://github.com/golang/go synced 2024-09-30 02:24:43 -06:00

cmd/internal/obj: don't crash on nil in Prog.String

I can't remember just how this happened to me, but I got an unfortunate
crash with some set of cmd/compile debug options and source code.

Change-Id: Ibef6129c50b68dad0594ac439466bfbc4b32a095
Reviewed-on: https://go-review.googlesource.com/19920
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2016-02-25 10:44:31 -08:00
parent d44088f173
commit 14113b3a89

View File

@ -287,6 +287,10 @@ func CConv(s uint8) string {
}
func (p *Prog) String() string {
if p == nil {
return "<nil Prog>"
}
if p.Ctxt == nil {
return "<Prog without ctxt>"
}