From 53b02c5e6fa4d5b500e1bd6cfae9399d6adaf798 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 25 Mar 2024 14:46:45 +0000 Subject: [PATCH] Fix printing errors issue --- src/error.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index e16909839..b18df79b7 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -600,7 +600,9 @@ gb_internal void syntax_error_with_verbose(TokenPos pos, TokenPos end, char cons gb_internal void compiler_error(char const *fmt, ...) { - print_all_errors(); + if (any_errors()) { + print_all_errors(); + } va_list va; @@ -614,7 +616,9 @@ gb_internal void compiler_error(char const *fmt, ...) { gb_internal void exit_with_errors(void) { - print_all_errors(); + if (any_errors()) { + print_all_errors(); + } gb_exit(1); }