When syntax.Parse returns error, noder.file will be nil. Currently, we
continue accessing it regardlessly and depend on gc.hidePanic to hide
the panic from user.
Instead, we should gracefully handle the error in LoadPackage, then exit
earlier if any error occurred.
Updates #43311
Change-Id: I0a108ef360bd4f0cc9f481071b8967355e1513af
Reviewed-on: https://go-review.googlesource.com/c/go/+/294030
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
let errchk exit 0 even if it has reported a BUG.
it echoed BUG and that's all that matters.
R=r
DELTA=143 (1 added, 89 deleted, 53 changed)
OCL=32533
CL=32542