summaryrefslogtreecommitdiff
path: root/mach_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-08-01 09:42:36 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-08-01 09:42:36 +0400
commitd6acbda22a4f5bdf4340edacdccf01cc7e38aea8 (patch)
treef2ef982c198353d4d602f3b6ad098f3f6e11e5dd /mach_dep.c
parent6605aebacb02bcce094db7a0ce07d8731b907955 (diff)
downloadbdwgc-d6acbda22a4f5bdf4340edacdccf01cc7e38aea8.tar.gz
Fix all address-of-dummy operations by adding volatile
* alloc.c (min_bytes_allocd, GC_stopped_mark): Use volatile for 'dummy' local variable (used to get 'sp' value) to prevent any harmful optimizations (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant). * dyn_load.c (GC_cond_add_roots): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * misc.c (GC_clear_stack_inner, GC_init, GC_call_with_stack_base): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, async_set_pht_entry_from_index): Likewise. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * tools/setjmp_t.c (main): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * dyn_load.c (dummy): Change variable type from char to int. * include/private/gcconfig.h: Update comment about GC_stackbottom initialization. * os_dep.c (GC_get_stack_base): Remove 'sp' local variable. * os_dep.c (GC_get_main_stack_base): Define and use volatile 'dummy' variable (instead of 'result') to get 'sp' value (revert part of commit bddc75f). * os_dep.c (GC_get_stack_base): Add missing cast of 'dummy' address (only if NEED_FIND_LIMIT). * pthread_stop_world.c (GC_suspend_handler_inner): Define and use volatile 'dummy' variable (instead of 'me') to get 'sp' value (revert part of commit 31fc0f6). * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Rename 'local_dummy' to 'dummy' local variable.
Diffstat (limited to 'mach_dep.c')
-rw-r--r--mach_dep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mach_dep.c b/mach_dep.c
index fc7dd8cf..0760d362 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -219,7 +219,7 @@
GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
ptr_t arg)
{
- word dummy;
+ volatile int dummy;
void * context = 0;
# if defined(HAVE_PUSH_REGS)