From 322436b78c2b0a8dd346f460df6fc00f49adba8e Mon Sep 17 00:00:00 2001 From: Mohit Agarwal Date: Thu, 3 Nov 2016 22:25:42 +0530 Subject: [PATCH] cmd/compile: don't panic if syntax.ReadFile returns an error Fixes #17772 Change-Id: I0f2094400c454828aa57a8d172dadeac4ddb6d35 Reviewed-on: https://go-review.googlesource.com/32691 Reviewed-by: Matthew Dempsky Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/noder.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index 4f1c883b5a..10bd09e72f 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -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)