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 <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2019-09-05 15:14:02 -07:00
parent 3aae49b8b4
commit 9da99049ba
1 changed files with 3 additions and 1 deletions

View File

@ -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() {