]> granicus.if.org Git - gc/commit
Fix all address-of-dummy operations by using GC_approx_sp() instead
authorIvan Maidanski <ivmai@mail.ru>
Wed, 1 Aug 2012 19:36:16 +0000 (23:36 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 1 Aug 2012 19:36:16 +0000 (23:36 +0400)
commit57b94a38df8026868010ec2ea0f47cd1f94f0c60
tree892427991e3845d03aa40309a1bbbc20e54a7af6
parent20616f1fce6d901e9bd79b797fce63f807651000
Fix all address-of-dummy operations by using GC_approx_sp() instead
(previous commit 'd6acbda' has not solved this problem)

* 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.
* 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.
* os_dep.c (currently_updating): Change type from "word" to "int*".
* os_dep.c (async_set_pht_entry_from_index): Remove volatile and casts
for 'update_dummy' local variable.
* tools/setjmp_t.c (main): Define volatile 'sp' local variable, store
its address to it and use it instead of "&dummy"; remove 'dummy' local
variable.
alloc.c
dyn_load.c
misc.c
os_dep.c
pthread_stop_world.c
pthread_support.c
ptr_chck.c
tools/setjmp_t.c
win32_threads.c