From dd2271d25b6934ad7ffad3507feca40beae8e45b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 2 Aug 2012 02:02:08 +0400 Subject: [PATCH] Fix GC_clear_stack_inner by using GC_approx_sp * misc.c (GC_clear_stack_inner): Use GC_approx_sp() instead of "dummy[0]" set to "&dummy" value (that worked as expected only for STACK_GROWS_DOWN case). --- misc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/misc.c b/misc.c index 98028b65..e3c4d1af 100644 --- a/misc.c +++ b/misc.c @@ -287,11 +287,8 @@ GC_INNER void GC_extend_size_map(size_t i) { volatile word dummy[CLEAR_SIZE]; - dummy[0] = (word)(&dummy); - /* Store to a volatile variable prevents the following */ - /* condition to be 'optimized' to TRUE constant. */ - BZERO((/* no volatile */ void *)&dummy[1], (CLEAR_SIZE-1) * sizeof(word)); - if (dummy[0] COOLER_THAN (word)limit) { + BZERO((/* no volatile */ void *)dummy, sizeof(dummy)); + if ((word)GC_approx_sp() COOLER_THAN (word)limit) { (void) GC_clear_stack_inner(arg, limit); } /* Make sure the recursive call is not a tail call, and the bzero */ -- 2.40.0