wingo pushed a commit to branch wip-whippet
in repository guile.

commit 478b9de798a17c0d2ae0852b63d70ddf335b23d0
Author: Andy Wingo <wi...@igalia.com>
AuthorDate: Fri Oct 4 13:50:35 2024 +0200

    Add assertions when pushing edge buffers
---
 src/field-set.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/field-set.h b/src/field-set.h
index 2c93232c1..4facab019 100644
--- a/src/field-set.h
+++ b/src/field-set.h
@@ -44,6 +44,7 @@ struct gc_field_set_writer {
 static void
 gc_edge_buffer_list_push(struct gc_edge_buffer_list *list,
                          struct gc_edge_buffer *buf) {
+  GC_ASSERT(!buf->next);
   struct gc_edge_buffer *next =
     atomic_load_explicit(&list->head, memory_order_relaxed);
   do {
@@ -72,6 +73,7 @@ static void
 gc_edge_buffer_stack_push(struct gc_edge_buffer_stack *stack,
                           struct gc_edge_buffer *buf,
                           const struct gc_lock *lock) {
+  GC_ASSERT(!buf->next);
   buf->next = stack->list.head;
   stack->list.head = buf;
 }

Reply via email to