diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-04-29 12:03:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-29 12:03:26 +0100 |
| commit | 2f88ded81a5ff691fda30054e1626f231af96cd8 (patch) | |
| tree | 4f79521c855633a5c6926ca42ff1b5c033ede853 /src/error.cpp | |
| parent | a37826e646c4c88974fad9a9ff1749e55dc7f52f (diff) | |
| parent | f1c13d6bd8ad7390ba29d5d6de79596b9b53bf24 (diff) | |
Merge pull request #3504 from Feoramund/fix-racecond-error-va
Fix race condition in `error_va`
Diffstat (limited to 'src/error.cpp')
| -rw-r--r-- | src/error.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/error.cpp b/src/error.cpp index bbbb98053..1b091f88e 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -376,11 +376,11 @@ gb_internal void error_out_coloured(char const *str, TerminalStyle style, Termin gb_internal void error_va(TokenPos const &pos, TokenPos end, char const *fmt, va_list va) { global_error_collector.count.fetch_add(1); + mutex_lock(&global_error_collector.mutex); if (global_error_collector.count > MAX_ERROR_COLLECTOR_COUNT()) { print_all_errors(); gb_exit(1); } - mutex_lock(&global_error_collector.mutex); push_error_value(pos, ErrorValue_Error); // NOTE(bill): Duplicate error, skip it |