aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/sym.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types/sym.go')
-rw-r--r--src/cmd/compile/internal/types/sym.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go
index 534cf7e237..fb642f52f8 100644
--- a/src/cmd/compile/internal/types/sym.go
+++ b/src/cmd/compile/internal/types/sym.go
@@ -110,6 +110,14 @@ func (a *Sym) Less(b *Sym) bool {
return false
}
+ // Nil before non-nil.
+ if a == nil {
+ return true
+ }
+ if b == nil {
+ return false
+ }
+
// Exported symbols before non-exported.
ea := IsExported(a.Name)
eb := IsExported(b.Name)