diff options
author | Matthew Dempsky <mdempsky@google.com> | 2020-11-13 20:38:21 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2020-11-24 19:34:23 +0000 |
commit | 88a9e2f9ad0ad3ef1e254e9150f4649e57b0a296 (patch) | |
tree | 6d87ae83b079712df42fc6dd51a7d477a4231340 /src/cmd/compile/internal/gc/obj.go | |
parent | 4af2decf3004261ff7cb500f511c6414a9d0f68a (diff) | |
download | go-88a9e2f9ad0ad3ef1e254e9150f4649e57b0a296.tar.gz go-88a9e2f9ad0ad3ef1e254e9150f4649e57b0a296.zip |
[dev.regabi] cmd/compile: replace CTNIL with ONIL
Properly speaking, "nil" is a zero value, not a constant. So
go/constant does not have a representation for it. To allow replacing
Val with constant.Value, we split out ONIL separately from OLITERAL so
we can get rid of CTNIL.
Passes toolstash-check.
Change-Id: I4c8e60cae3b3c91bbac43b3b0cf2a4ade028d6cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/272650
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/obj.go')
-rw-r--r-- | src/cmd/compile/internal/gc/obj.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 8fe480b65f..77f9afb44d 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -591,12 +591,15 @@ func litsym(n, c *Node, wid int) { if n.Op != ONAME { Fatalf("litsym n op %v", n.Op) } - if c.Op != OLITERAL { - Fatalf("litsym c op %v", c.Op) - } if n.Sym == nil { Fatalf("litsym nil n sym") } + if c.Op == ONIL { + return + } + if c.Op != OLITERAL { + Fatalf("litsym c op %v", c.Op) + } s := n.Sym.Linksym() switch u := c.Val().U.(type) { case bool: |