1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:24:42 -07:00

cmd/compile: use nodl in zeroResults

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>
This commit is contained in:
Tobias Klauser 2018-03-13 13:01:36 +01:00 committed by Josh Bleecher Snyder
parent b00f72e08a
commit 6428c892c0

View 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