]> granicus.if.org Git - gc/commitdiff
Fix GC_inner_start_routine() to prevent local variable clobbering.
authorIvan Maidanski <ivmai@mail.ru>
Tue, 20 Sep 2011 08:15:17 +0000 (12:15 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 20 Sep 2011 08:15:17 +0000 (12:15 +0400)
* pthread_start.c (GC_inner_start_routine): Add volatile to "me" local
variable to prevent its clobbering.

pthread_start.c

index 9d3556b4d85fd98ec830744130db517a46020789..bb79f5fb47326012aa5a1d48b3ae1cfc6f5492c9 100644 (file)
@@ -47,7 +47,8 @@ void * GC_CALLBACK GC_inner_start_routine(struct GC_stack_base *sb, void *arg)
   void * (*start)(void *);
   void * start_arg;
   void * result;
-  GC_thread me = GC_start_rtn_prepare_thread(&start, &start_arg, sb, arg);
+  volatile GC_thread me =
+                GC_start_rtn_prepare_thread(&start, &start_arg, sb, arg);
 
 # ifndef NACL
     pthread_cleanup_push(GC_thread_exit_proc, me);