]> Cypherpunks repositories - gostls13.git/commitdiff
gc: look at cumulative error count, not just per-function.
authorLuuk van Dijk <lvd@golang.org>
Sat, 12 Nov 2011 05:32:56 +0000 (00:32 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 12 Nov 2011 05:32:56 +0000 (00:32 -0500)
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

index 83486e576237faa52bf9d4b559456a869e3ee773..adf8eb16c200b9e76f1b74a96f6194ba7ed02642 100644 (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();