diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go index d692bf97aaf..8c456e4561e 100644 --- a/src/cmd/compile/internal/noder/noder.go +++ b/src/cmd/compile/internal/noder/noder.go @@ -68,6 +68,9 @@ func LoadPackage(filenames []string) { for e := range p.err { p.errorAt(e.Pos, "%s", e.Msg) } + if p.file == nil { + base.ErrorExit() + } lines += p.file.EOF.Line() } base.Timer.AddEvent(int64(lines), "lines") diff --git a/test/fixedbugs/bug050.go b/test/fixedbugs/bug050.go index aba68b1dcbb..1e299ed99a8 100644 --- a/test/fixedbugs/bug050.go +++ b/test/fixedbugs/bug050.go @@ -1,4 +1,4 @@ -// errorcheck +// errorcheck -d=panic // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style