]> granicus.if.org Git - gc/commitdiff
2007-08-14 Hans Boehm <Hans.Boehm@hp.com> (partly really Henrik Theiling)
authorhboehm <hboehm>
Tue, 14 Aug 2007 19:48:22 +0000 (19:48 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:41 +0000 (21:06 +0400)
* 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
include/gc.h
tests/test.c

index e37c0085ba853a4451fb20fe90e2deee63eb03a6..40c37b2c6ec836884d0fb06128497605895fd34b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (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 <Hans.Boehm@hp.com>
        
        * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
index ec15bbd296b432223b75c9744ce08131bf19bb6a..4c09b6fd6f4cddc0bfc2c7e8f4512c63dd4bae30 100644 (file)
@@ -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 */
index a6db6ff7fba4b958c8db3f26b8ef78909bcbeab4..afe80f2a816d44af19c8f3d4c9f311bd99d03671 100644 (file)
@@ -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.                              */