1
0
mirror of https://github.com/golang/go synced 2024-11-17 18:24:45 -07:00

cmd/compile: do not push functions literal node to Func.Dcl

They are skipped while processing Func.Dcl anyway.

This CL does not pass toolstash-check, because it reduces the length
of Func.Dcl length, while that length is used to generate autotmp
variables name.

Change-Id: I408183e62ce6c34e5f04c89814ebb9570957e37b
Reviewed-on: https://go-review.googlesource.com/c/go/+/252418
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2020-09-02 12:45:07 +07:00
parent 0e48c674f5
commit ace37d35f1

View File

@ -90,7 +90,7 @@ func declare(n *Node, ctxt Class) {
lineno = n.Pos
Fatalf("automatic outside function")
}
if Curfn != nil {
if Curfn != nil && ctxt != PFUNC {
Curfn.Func.Dcl = append(Curfn.Func.Dcl, n)
}
if n.Op == OTYPE {