From 3208917d54fea665392b692dee1bf1a921510fc2 Mon Sep 17 00:00:00 2001 From: Luuk van Dijk Date: Sat, 12 Nov 2011 00:32:56 -0500 Subject: [PATCH] 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 --- src/cmd/gc/subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();