commit | dab199c9c10717bd134edacdfddf084b9295b1b7 | [log] [tgz] |
---|---|---|
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | Sun Oct 13 23:37:14 2019 +0700 |
committer | Keith Randall <khr@golang.org> | Mon Oct 14 17:44:32 2019 +0000 |
tree | 9c15a69b79c23bb73f652cc138ebe4f7f82a0e85 | |
parent | 4c9e757daf813fcc02802d0ff014afa24df56f6e [diff] |
cmd/compile: consistenly use CTxxx for works relate to Ctype Passes toolstash-check Change-Id: Iaeaf2575b9f492e45619007438c0138f9d22006c Reviewed-on: https://go-review.googlesource.com/c/go/+/200959 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 3666ddb..0c03aad 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go
@@ -552,7 +552,7 @@ func consttype(n *Node) Ctype { if n == nil || n.Op != OLITERAL { - return 0 + return CTxxx } return n.Val().Ctype() }
diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go index 0e28f82..939f3df 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go
@@ -202,7 +202,7 @@ // The result of addrTemp MUST be assigned back to n, e.g. // n.Left = o.addrTemp(n.Left) func (o *Order) addrTemp(n *Node) *Node { - if consttype(n) > 0 { + if consttype(n) != CTxxx { // TODO: expand this to all static composite literal nodes? n = defaultlit(n, nil) dowidth(n.Type)