From 4d6dd8b78fdfb0d60fa686263363e07a4bb5137c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 17 Oct 2012 21:21:11 +0400 Subject: [PATCH] Fix sizeof in GC_push_thread_structures * pthread_support.c (GC_push_thread_structures): Fix sizeof argument (take size of GC_thread_key variable instead of its address) if THREAD_LOCAL_ALLOC. * win32_threads.c (GC_push_thread_structures): Likewise. --- pthread_support.c | 2 +- win32_threads.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pthread_support.c b/pthread_support.c index 40c6683a..24e8288e 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -448,7 +448,7 @@ void GC_push_thread_structures(void) GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads)); # if defined(THREAD_LOCAL_ALLOC) GC_push_all((ptr_t)(&GC_thread_key), - (ptr_t)(&GC_thread_key) + sizeof(&GC_thread_key)); + (ptr_t)(&GC_thread_key) + sizeof(GC_thread_key)); # endif } diff --git a/win32_threads.c b/win32_threads.c index aa239b26..96f62ed0 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1105,7 +1105,7 @@ void GC_push_thread_structures(void) } # if defined(THREAD_LOCAL_ALLOC) GC_push_all((ptr_t)(&GC_thread_key), - (ptr_t)(&GC_thread_key)+sizeof(&GC_thread_key)); + (ptr_t)(&GC_thread_key) + sizeof(GC_thread_key)); /* Just in case we ever use our own TLS implementation. */ # endif } -- 2.40.0