From: Ivan Maidanski Date: Wed, 2 Oct 2019 21:23:31 +0000 (+0300) Subject: Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03109f287;p=gc Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start (fix of commit 38d07c167) * mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && GC_WIN32_THREADS && !GC_PTHREADS] (GC_mark_some): If GC_started_thread_while_stopped() then goto handle_thr_start instead of handle_ex. * mark.c [WRAP_MARK_SOME && GC_WIN32_THREADS && !GC_PTHREADS] (GC_mark_some): Define handle_thr_start label right after WARN() call. --- diff --git a/mark.c b/mark.c index 0a1d1394..e6f09159 100644 --- a/mark.c +++ b/mark.c @@ -493,7 +493,8 @@ static void alloc_mark_stack(size_t); /* to the exception case; our results are invalid and we have */ /* to start over. This cannot be prevented since we can't */ /* block in DllMain. */ - if (GC_started_thread_while_stopped()) goto handle_ex; + if (GC_started_thread_while_stopped()) + goto handle_thr_start; # endif rm_handler: return ret_val; @@ -530,7 +531,7 @@ static void alloc_mark_stack(size_t); goto handle_ex; # if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) if (GC_started_thread_while_stopped()) - goto handle_ex; + goto handle_thr_start; # endif rm_handler: /* Uninstall the exception handler. */ @@ -571,6 +572,9 @@ handle_ex: warned_gc_no = GC_gc_no; } } +# if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) + handle_thr_start: +# endif /* We have bad roots on the stack. Discard mark stack. */ /* Rescan from marked objects. Redetermine roots. */ # ifdef REGISTER_LIBRARIES_EARLY