From: Luuk van Dijk Date: Sat, 12 Nov 2011 05:32:56 +0000 (-0500) Subject: gc: look at cumulative error count, not just per-function. X-Git-Tag: weekly.2011-11-18~96 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3208917d54fea665392b692dee1bf1a921510fc2;p=gostls13.git 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 --- diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 83486e5762..adf8eb16c2 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -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();