]> granicus.if.org Git - gc/commit
Fix all address-of-dummy operations by adding volatile
authorIvan Maidanski <ivmai@mail.ru>
Wed, 1 Aug 2012 05:42:36 +0000 (09:42 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 1 Aug 2012 05:42:36 +0000 (09:42 +0400)
commitd6acbda22a4f5bdf4340edacdccf01cc7e38aea8
treef2ef982c198353d4d602f3b6ad098f3f6e11e5dd
parent6605aebacb02bcce094db7a0ce07d8731b907955
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.
alloc.c
dyn_load.c
include/private/gcconfig.h
mach_dep.c
misc.c
os_dep.c
pthread_stop_world.c
pthread_support.c
ptr_chck.c
tools/setjmp_t.c
win32_threads.c