]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: restore lineno before returning in defaultlitreuse
authorMatthew Dempsky <mdempsky@google.com>
Thu, 5 Sep 2019 22:14:02 +0000 (15:14 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 6 Sep 2019 06:20:27 +0000 (06:20 +0000)
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>
src/cmd/compile/internal/gc/const.go

index 6d39417ba5ab326a5056796a5227d70974643602..c5b8d816c6c080126e7bbcb8118e97df672b8b9e 100644 (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() {