diff options
| author | 2025-12-20 12:11:34 +0100 | |
|---|---|---|
| committer | 2025-12-20 12:11:34 +0100 | |
| commit | 2b424fd89b12d7f2eb3a8c9ca872bb4318179d46 (patch) | |
| tree | 9cab1e51881d1a700955dc1b2dfb1b0a1d0d3f87 /io.c | |
| parent | 640d5e95560d3c9099a58e09a93831197b863a2b (diff) | |
quit after emitting too many errors
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1099,6 +1099,7 @@ fatal(const struct span *span, const char *fmt, ...) } int nerror; +enum { MAXERROR = 20 }; void error(const struct span *span, const char *fmt, ...) @@ -1109,6 +1110,10 @@ error(const struct span *span, const char *fmt, ...) va_start(ap, fmt); vdiag(span, DGERROR, fmt, ap); va_end(ap); + if (nerror > MAXERROR) { + efmt("Too many errors emitted, stopping now.\n"); + exit(1); + } } void |