]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use nodl in zeroResults
authorTobias Klauser <tklauser@distanz.ch>
Tue, 13 Mar 2018 12:01:36 +0000 (13:01 +0100)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 8 May 2018 14:38:55 +0000 (14:38 +0000)
Use nodl instead of nod to avoid setting and resetting lineo.

Passes toolstash-check.

Updates #19683

Change-Id: I6a47a7ba43a11352767029eced29f08dff8501a2
Reviewed-on: https://go-review.googlesource.com/100335
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/walk.go

index edf06579234dc3515e5cf3ab908d0da7274eee06..ead578fb33f19a3ab4193f1003aff3d311e37905 100644 (file)
@@ -2669,8 +2669,6 @@ func paramstoheap(params *types.Type) []*Node {
 // even allocations to move params/results to the heap.
 // The generated code is added to Curfn's Enter list.
 func zeroResults() {
-       lno := lineno
-       lineno = Curfn.Pos
        for _, f := range Curfn.Type.Results().Fields().Slice() {
                if v := asNode(f.Nname); v != nil && v.Name.Param.Heapaddr != nil {
                        // The local which points to the return value is the
@@ -2679,9 +2677,8 @@ func zeroResults() {
                        continue
                }
                // Zero the stack location containing f.
-               Curfn.Func.Enter.Append(nod(OAS, nodarg(f, 1), nil))
+               Curfn.Func.Enter.Append(nodl(Curfn.Pos, OAS, nodarg(f, 1), nil))
        }
-       lineno = lno
 }
 
 // returnsfromheap returns code to copy values for heap-escaped parameters