]> granicus.if.org Git - gc/commitdiff
Fix sizeof in GC_push_thread_structures
authorIvan Maidanski <ivmai@mail.ru>
Wed, 17 Oct 2012 17:21:11 +0000 (21:21 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 17 Oct 2012 17:21:11 +0000 (21:21 +0400)
* 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
win32_threads.c

index 40c6683a1478673511b3b660ef48734df093f84e..24e8288e7b21978aada02bea4e904dff61b3e9b3 100644 (file)
@@ -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
 }
 
index aa239b260240205783fc89a8b7aabf6c815c50b0..96f62ed09a44a3d3fdfdd1fc16eabe793a52ba82 100644 (file)
@@ -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
 }