mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
4af2decf30
commit
88a9e2f9ad
18 changed files with 100 additions and 87 deletions
|
|
@ -294,7 +294,7 @@ func (n *Node) SetIota(x int64) {
|
|||
// Extra care must be taken when mutating such a node.
|
||||
func (n *Node) mayBeShared() bool {
|
||||
switch n.Op {
|
||||
case ONAME, OLITERAL, OTYPE:
|
||||
case ONAME, OLITERAL, ONIL, OTYPE:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue