]> granicus.if.org Git - gc/commitdiff
Fix unneeded end_stubborn_change/ptr_store_and_dirty in disclaim_test
authorIvan Maidanski <ivmai@mail.ru>
Mon, 17 Sep 2018 06:49:56 +0000 (09:49 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 19 Sep 2018 07:11:28 +0000 (10:11 +0300)
(fix of commits b52c140263ffbb)

* tests/disclaim_test.c (pair_dct): Add my_assert that cd is null;
store null to p->car (instead of storing cd and calling
GC_end_stubborn_change/GC_reachable_here).

tests/disclaim_test.c

index edb6d0f414609b75cbd412f170660e7485145e54..ca0925225977130ca47abfea13f1434f3b03b5c3 100644 (file)
@@ -109,6 +109,7 @@ void GC_CALLBACK pair_dct(void *obj, void *cd)
     pair_t p = (pair_t)obj;
     int checksum;
 
+    my_assert(cd == NULL);
     /* Check that obj and its car and cdr are not trashed. */
 #   ifdef DEBUG_DISCLAIM_DESTRUCT
       printf("Destruct %p = (%p, %p)\n",
@@ -126,8 +127,8 @@ void GC_CALLBACK pair_dct(void *obj, void *cd)
     /* Invalidate it. */
     memset(p->magic, '*', sizeof(p->magic));
     p->checksum = 0;
+    p->car = NULL;
     p->cdr = NULL;
-    GC_ptr_store_and_dirty(&p->car, cd);
 }
 
 pair_t