Fix 'context local variable might be clobbered by setjmp' compiler warning
authorIvan Maidanski <ivmai@mail.ru>
Mon, 5 Dec 2016 23:21:33 +0000 (02:21 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 5 Dec 2016 23:21:33 +0000 (02:21 +0300)
* mach_dep.c (GC_with_callee_saves_pushed): Mark "context" local
variable as volatile (to prevent it from potential clobbering).

mach_dep.c

index 850a990..62b7a37 100644 (file)
@@ -226,7 +226,7 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
                                           GC_ATTR_NO_SANITIZE_ADDR
 {
   volatile int dummy;
-  void * context = 0;
+  void * volatile context = 0;
 
 # if defined(HAVE_PUSH_REGS)
     GC_push_regs();