diff options
author | Matthew Dempsky <mdempsky@google.com> | 2020-09-16 15:41:47 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2020-09-16 23:00:02 +0000 |
commit | f5d59d0e382dc59195537a128fe9423a49a4cea8 (patch) | |
tree | dc48bbae157d32b7fc41bd73968011dd7e6602e1 /src/cmd/compile/internal/gc/main.go | |
parent | 396688af7ee121d478e9b8d2cc9d06999ba7fc6e (diff) | |
download | go-f5d59d0e382dc59195537a128fe9423a49a4cea8.tar.gz go-f5d59d0e382dc59195537a128fe9423a49a4cea8.zip |
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 <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
-rw-r--r-- | src/cmd/compile/internal/gc/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
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() |