thirdparty: patch thirdparty/libgc/gc.c to make -cc gcc-11 -cstrict pass in more cases

This commit is contained in:
Delyan Angelov 2024-08-01 11:11:27 +03:00
parent 0b3853683b
commit cca6755d28
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -35507,6 +35507,7 @@ STATIC void GC_suspend_handler_inner(ptr_t dummy, void *context)
GC_log_printf("Suspending %p\n", (void *)pthread_self());
# endif
me = GC_lookup_self_thread_async();
if (NULL == me) return NULL; // __v_, make the sanitizers and -cstrict happy
if ((me -> last_stop_count & ~(word)THREAD_RESTARTED) == my_stop_count) {
/* Duplicate signal. OK if we are retrying. */
if (!GC_retry_signals) {
@ -37527,7 +37528,10 @@ STATIC GC_thread GC_self_thread(void) {
GC_INNER void GC_reset_finalizer_nested(void)
{
GC_ASSERT(I_HOLD_LOCK());
GC_self_thread_inner() -> crtn -> finalizer_nested = 0;
GC_thread me;
me = GC_self_thread_inner();
if (NULL == me) return; // __v_, make the sanitizers and -cstrict happy
me -> crtn -> finalizer_nested = 0;
}
/* Checks and updates the thread-local level of finalizers recursion. */
@ -37549,6 +37553,7 @@ STATIC GC_thread GC_self_thread(void) {
/* to be called before the thread gets registered. */
if (EXPECT(NULL == me, FALSE)) return NULL;
# endif
if (NULL == me) return NULL; // __v_, make the sanitizers and -cstrict happy
crtn = me -> crtn;
nesting_level = crtn -> finalizer_nested;
if (nesting_level) {