]> granicus.if.org Git - gc/commit
Fix all address-of-dummy operations by using GC_approx_sp() instead
authorIvan Maidanski <ivmai@mail.ru>
Thu, 2 Aug 2012 03:42:43 +0000 (07:42 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 2 Aug 2012 10:13:22 +0000 (14:13 +0400)
commiteaa32b40b80f8207c0959a90fbd420042c081aad
tree336d7fa1bc8cd465865af2f29919b91336958c50
parent9682468edd6bfe166c63ac4b3902085be05fbe60
Fix all address-of-dummy operations by using GC_approx_sp() instead
(a joint commit of commits 'd6acbd' and '57b94a3' in master branch)

* alloc.c (min_bytes_allocd, GC_stopped_mark): Use GC_approx_sp()
instead of "&dummy"; remove 'dummy' local variable.
* dyn_load.c (GC_cond_add_roots): Likewise.
* misc.c (GC_init): Likewise.
* os_dep.c (GC_get_stack_base, GC_get_main_stack_base): Likewise.
* pthread_stop_world.c (GC_suspend_handler_inner,
nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise.
* pthread_support.c (GC_thr_init): Likewise.
* ptr_chck.c (GC_on_stack): Likewise.
* win32_threads.c (GC_push_stack_for): Likewise.
* extra/setjmp_t.c (main): Define volatile 'sp' local variable, store
its address to it and use it instead of "&dummy"; remove 'dummy' local
variable.
* mach_dep.c (GC_with_callee_saves_pushed): Use volatile for 'dummy'
local variable.
* misc.c (GC_clear_stack_inner): Store address of volatile 'dummy'
local array (i.e. 'sp' value) to its first element (and use it in the
comparison of addresses) to prevent any harmful optimizations as C
officially disallows comparisons of pointers to different objects
(e.g., some Mac OS X clang releases might turn a conditional
expression that uses 'dummy' address into a constant); update comment.
* misc.c (GC_call_with_stack_base): Use "&base" instead of "&dummy"
(it is safe to use address of base here); remove dummy variable.
alloc.c
dyn_load.c
extra/setjmp_t.c
mach_dep.c
misc.c
os_dep.c
pthread_stop_world.c
pthread_support.c
ptr_chck.c
win32_threads.c