From 684acad26318a6a0e3eb37c1b886136a217ea4fb Mon Sep 17 00:00:00 2001 From: Benjamin Oldenburg Date: Mon, 16 Mar 2026 00:49:24 +0700 Subject: [PATCH] bcheck: restore atomic never_fatal on Windows --- lib/bcheck.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/bcheck.c b/lib/bcheck.c index c427647e..e329753d 100644 --- a/lib/bcheck.c +++ b/lib/bcheck.c @@ -351,11 +351,8 @@ static unsigned char print_heap; static unsigned char print_statistic; static unsigned char no_strdup; static unsigned char use_sem; -#ifdef _WIN32 -static int never_fatal; -#else +/* This counter is toggled from runtime/error paths and must remain atomic. */ static _Atomic int never_fatal; -#endif #if HAVE_TLS_FUNC #if defined(_WIN32) static int no_checking = 0; @@ -511,11 +508,7 @@ void __bound_checking_unlock(void) /* enable/disable checking. This can be used in signal handlers. */ void __bound_never_fatal (int neverfatal) { -#ifdef _WIN32 - never_fatal += neverfatal; -#else atomic_fetch_add (&never_fatal, neverfatal); -#endif } /* return '(p + offset)' for pointer arithmetic (a pointer can reach