From: Russ Cox Date: Wed, 23 Dec 2020 04:46:07 +0000 (-0500) Subject: [dev.regabi] cmd/compile: do not die in early base.FlushErrors X-Git-Tag: go1.17beta1~1539^2~264 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=69cf39089f3e5e6e5356c90c1bd8f30f76658bd0;p=gostls13.git [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 Run-TryBot: Russ Cox Reviewed-by: Matthew Dempsky --- 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 }