mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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:
parent
d44088f173
commit
14113b3a89
1 changed files with 4 additions and 0 deletions
|
|
@ -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>"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue