From dab199c9c10717bd134edacdfddf084b9295b1b7 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Sun, 13 Oct 2019 23:37:14 +0700 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/const.go | 2 +- src/cmd/compile/internal/gc/order.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 3666ddbaa0..0c03aad12b 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -552,7 +552,7 @@ func tostr(v Val) Val { 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 0e28f8267f..939f3df93a 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go @@ -202,7 +202,7 @@ func isaddrokay(n *Node) bool { // 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)