[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>
This commit is contained in:
Russ Cox 2020-12-22 23:46:07 -05:00
parent 6d03cde88a
commit 69cf39089f

View file

@ -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
}