1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:24:41 -07:00

gc: look at cumulative error count, not just per-function.

Not sure if this is what you'd really want.  Maybe with a higher limit than 10
or perhaps keep checking nerrors > 10 per yyerror, but check the cumulative
after each function?

R=rsc
CC=golang-dev
https://golang.org/cl/5376064
This commit is contained in:
Luuk van Dijk 2011-11-12 00:32:56 -05:00 committed by Russ Cox
parent 9192548f80
commit 3208917d54

View File

@ -119,7 +119,7 @@ yyerrorl(int line, char *fmt, ...)
hcrash();
nerrors++;
if(nerrors >= 10 && !debug['e']) {
if(nsavederrors+nerrors >= 10 && !debug['e']) {
flusherrors();
print("%L: too many errors\n", line);
errorexit();
@ -187,7 +187,7 @@ yyerror(char *fmt, ...)
hcrash();
nerrors++;
if(nerrors >= 10 && !debug['e']) {
if(nsavederrors+nerrors >= 10 && !debug['e']) {
flusherrors();
print("%L: too many errors\n", parserline());
errorexit();