From: Matthew Dempsky Date: Wed, 16 Sep 2020 22:41:47 +0000 (-0700) Subject: cmd/compile: skip looking for OCLOSURE nodes in xtop X-Git-Tag: go1.16beta1~1025 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f5d59d0e382dc59195537a128fe9423a49a4cea8;p=gostls13.git cmd/compile: skip looking for OCLOSURE nodes in xtop xtop holds package's top-level declaration statements, but OCLOSURE only appears in expression contexts. xtop will instead hold the synthetic ODCLFUNC representing OCLOSURE's function body. This CL makes the loop consistent with the later phases that only look for ODCLFUNC nodes in xtop. Passes toolstash-check. Change-Id: I852a10ef1bf75bb3351e3da0357ca8b2e26aec6e Reviewed-on: https://go-review.googlesource.com/c/go/+/255340 Trust: Matthew Dempsky Run-TryBot: Matthew Dempsky Reviewed-by: Cuong Manh Le TryBot-Result: Go Bot --- diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 8783cb4e46..7ad3bfe0c8 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -617,7 +617,7 @@ func Main(archInit func(*Arch)) { var fcount int64 for i := 0; i < len(xtop); i++ { n := xtop[i] - if op := n.Op; op == ODCLFUNC || op == OCLOSURE { + if n.Op == ODCLFUNC { Curfn = n decldepth = 1 saveerrors()