]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: assign results of transformAssign back to source location
authorKeith Randall <khr@golang.org>
Tue, 31 Aug 2021 21:53:53 +0000 (14:53 -0700)
committerKeith Randall <khr@golang.org>
Wed, 1 Sep 2021 03:50:19 +0000 (03:50 +0000)
Otherwise the modifications of transformAssign are dropped on the floor.

Change-Id: Id40782564952ed53f9ade1dba4e85290c8522abc
Reviewed-on: https://go-review.googlesource.com/c/go/+/346590
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/stencil.go

index 17173179250b6b85e262eb87f15655f68816cb72..7ba266a150515c049aa2315aa3e81b22120b7d6f 100644 (file)
@@ -966,6 +966,7 @@ func (subst *subster) node(n ir.Node) ir.Node {
                                        // of zeroing assignment of a dcl (rhs[0] is nil).
                                        lhs, rhs := []ir.Node{as.X}, []ir.Node{as.Y}
                                        transformAssign(as, lhs, rhs)
+                                       as.X, as.Y = lhs[0], rhs[0]
                                }
 
                        case ir.OASOP: