diff options
| author | Russ Cox <rsc@golang.org> | 2020-12-22 23:46:07 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-12-23 05:03:59 +0000 |
| commit | 69cf39089f3e5e6e5356c90c1bd8f30f76658bd0 (patch) | |
| tree | 143fffde8c3beba68823bb1185f1219d2cd91037 /src/cmd/compile/internal/base/print.go | |
| parent | 6d03cde88a0599bd0a8d6cb1e5b08c5d0a06020a (diff) | |
| download | go-git-69cf39089f3e5e6e5356c90c1bd8f30f76658bd0.tar.gz | |
[dev.regabi] cmd/compile: do not die in early base.FlushErrors
Change-Id: I72bac8a85db14494298059f8efddc5cbbf45f7ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/279214
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/base/print.go')
| -rw-r--r-- | src/cmd/compile/internal/base/print.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/base/print.go b/src/cmd/compile/internal/base/print.go index 6831b3ada3..ac7333ca4e 100644 --- a/src/cmd/compile/internal/base/print.go +++ b/src/cmd/compile/internal/base/print.go @@ -73,7 +73,9 @@ func (x byPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } // FlushErrors sorts errors seen so far by line number, prints them to stdout, // and empties the errors array. func FlushErrors() { - Ctxt.Bso.Flush() + if Ctxt != nil && Ctxt.Bso != nil { + Ctxt.Bso.Flush() + } if len(errorMsgs) == 0 { return } |
