1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:51: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:
Josh Bleecher Snyder 2015-08-22 13:30:45 -07:00
parent 0ffd9c8cad
commit 220e705404

View File

@ -48,6 +48,9 @@ type Value struct {
// short form print. Just v#.
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)
}