From 2b424fd89b12d7f2eb3a8c9ca872bb4318179d46 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Dec 2025 12:11:34 +0100 Subject: quit after emitting too many errors --- io.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index cbb8568..35da15a 100644 --- a/io.c +++ b/io.c @@ -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 -- cgit v1.2.3