From 478b9de798a17c0d2ae0852b63d70ddf335b23d0 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 4 Oct 2024 13:50:35 +0200 Subject: [PATCH] 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; }