From: Cuong Manh Le Date: Wed, 2 Sep 2020 05:45:07 +0000 (+0700) Subject: cmd/compile: do not push functions literal node to Func.Dcl X-Git-Tag: go1.16beta1~1135 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ace37d35f18675ac935dc2c6b534dda32ebe84e5;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go index 4f6fddd089..6dc6f4db70 100644 --- a/src/cmd/compile/internal/gc/dcl.go +++ b/src/cmd/compile/internal/gc/dcl.go @@ -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 {