From 3bfe50b3c4cc76b5b1774ae2fe5cd3f25ac7db30 Mon Sep 17 00:00:00 2001 From: hboehm Date: Tue, 14 Aug 2007 19:48:22 +0000 Subject: [PATCH] 2007-08-14 Hans Boehm (partly really Henrik Theiling) * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses. * tests/test.c (run_one_test): Add GC_PTR_STORE test. No longer test for RS6000. --- ChangeLog | 6 ++++++ include/gc.h | 2 +- tests/test.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37c0085..40c37b2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-14 Hans Boehm (partly really Henrik Theiling) + + * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses. + * tests/test.c (run_one_test): Add GC_PTR_STORE test. + No longer test for RS6000. + 2007-08-03 Hans Boehm * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h: diff --git a/include/gc.h b/include/gc.h index ec15bbd2..4c09b6fd 100644 --- a/include/gc.h +++ b/include/gc.h @@ -960,7 +960,7 @@ void GC_dump(void); # define GC_PTR_STORE(p, q) \ (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q)) #else /* !GC_DEBUG */ -# define GC_PTR_STORE(p, q) *((p) = (q)) +# define GC_PTR_STORE(p, q) (*(p) = (q)) #endif /* Functions called to report pointer checking errors */ diff --git a/tests/test.c b/tests/test.c index a6db6ff7..afe80f2a 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1023,6 +1023,7 @@ static void uniq(void *p, ...) { void run_one_test() { char *x; + char **z; # ifdef LINT char *y = 0; # else @@ -1077,9 +1078,15 @@ void run_one_test() (void)GC_printf("GC_is_visible produced incorrect result\n"); FAIL; } + z = GC_malloc(8); + GC_PTR_STORE(z, x); + if (*z != x) { + (void)GC_printf("GC_PTR_STORE failed: %p != %p\n", *z, x); + FAIL; + } if (!TEST_FAIL_COUNT(1)) { -# if!(defined(RS6000) || defined(POWERPC) || defined(IA64)) || defined(M68K) - /* ON RS6000s function pointers point to a descriptor in the */ +# if!(defined(POWERPC) || defined(IA64)) || defined(M68K) + /* On POWERPCs function pointers point to a descriptor in the */ /* data segment, so there should have been no failures. */ /* The same applies to IA64. Something similar seems to */ /* be going on with NetBSD/M68K. */ -- 2.40.0