From 9da99049ba45abb4e3b91ba30a4af8dc2d24f1b1 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 5 Sep 2019 15:14:02 -0700 Subject: [PATCH] cmd/compile: restore lineno before returning in defaultlitreuse This affects the position information that's associated with the implicit OCONV nodes created in assignconvfn. Not super important and the followup rewrite CL fixes this too, but fixing it separately is easy and makes toolstash-check happier. Change-Id: Ifd65dc524b367812d14a4d996647a5d40665fb38 Reviewed-on: https://go-review.googlesource.com/c/go/+/193606 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/const.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 6d39417ba5..c5b8d816c6 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -1173,7 +1173,9 @@ func defaultlitreuse(n *Node, t *types.Type, reuse canReuseNode) *Node { switch ctype { default: if t != nil { - return convlit(n, t) + n = convlit(n, t) + lineno = lno + return n } switch n.Val().Ctype() { -- 2.50.0