Commit 322436b7 authored by Mohit Agarwal's avatar Mohit Agarwal Committed by Matthew Dempsky

cmd/compile: don't panic if syntax.ReadFile returns an error

Fixes #17772

Change-Id: I0f2094400c454828aa57a8d172dadeac4ddb6d35
Reviewed-on: https://go-review.googlesource.com/32691Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 4141054d
......@@ -17,7 +17,8 @@ func parseFile(filename string) {
p := noder{baseline: lexlineno}
file, err := syntax.ReadFile(filename, p.error, p.pragma, 0)
if err != nil {
Fatalf("syntax.ReadFile %s: %v", filename, err)
fmt.Printf("parse %s: %v\n", filename, err)
errorexit()
}
p.file(file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment