mirror of
https://github.com/golang/go
synced 2024-10-05 21:21:21 -06:00
[dev.ssa] cmd/compile: make "*Value".String more robust
Change-Id: I4ae38440a33574421c9e3e350701e86e8a224b92 Reviewed-on: https://go-review.googlesource.com/13842 Reviewed-by: Todd Neal <todd@tneal.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
0ffd9c8cad
commit
220e705404
@ -48,6 +48,9 @@ type Value struct {
|
|||||||
|
|
||||||
// short form print. Just v#.
|
// short form print. Just v#.
|
||||||
func (v *Value) String() string {
|
func (v *Value) String() string {
|
||||||
|
if v == nil {
|
||||||
|
return "nil" // should never happen, but not panicking helps with debugging
|
||||||
|
}
|
||||||
return fmt.Sprintf("v%d", v.ID)
|
return fmt.Sprintf("v%d", v.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user