Commit d159d610 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: terminate compilation if type-checking fails

There is no benefit in continuing compilation if there
are type-checking errors. This will increase robustness
of the compiler in the presence of errors.

Fixes #22909.

Change-Id: I1c70c667e5927646ba3d0f370e33705165620f12
Reviewed-on: https://go-review.googlesource.com/116335Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent b0951aff
...@@ -532,6 +532,10 @@ func Main(archInit func(*Arch)) { ...@@ -532,6 +532,10 @@ func Main(archInit func(*Arch)) {
checkMapKeys() checkMapKeys()
timings.AddEvent(fcount, "funcs") timings.AddEvent(fcount, "funcs")
if nsavederrors+nerrors != 0 {
errorexit()
}
// Phase 4: Decide how to capture closed variables. // Phase 4: Decide how to capture closed variables.
// This needs to run before escape analysis, // This needs to run before escape analysis,
// because variables captured by value do not escape. // because variables captured by value do not escape.
......
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