summaryrefslogtreecommitdiff
path: root/lib/lists.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-12-06 19:03:00 +0100
committerMaria Matejka <mq@ucw.cz>2021-12-07 13:05:20 +0100
commit4f43d326b4ab8c8ddd4bc00152859e768c27590a (patch)
treebf37bbfed032ea2c9bd9d4ec8f6932a9495f2229 /lib/lists.c
parente32eafaaa76c27fe5cae496e500e257a5dede7f3 (diff)
Event list asserts to prevent running into rotten data
Diffstat (limited to 'lib/lists.c')
-rw-r--r--lib/lists.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/lists.c b/lib/lists.c
index dc2e4cbb..2f92defe 100644
--- a/lib/lists.c
+++ b/lib/lists.c
@@ -208,6 +208,9 @@ add_tail_list(list *to, list *l)
EXPENSIVE_CHECK(check_list(to, NULL));
EXPENSIVE_CHECK(check_list(l, NULL));
+ ASSERT_DIE(l->head->prev == &l->head_node);
+ ASSERT_DIE(l->tail->next == &l->tail_node);
+
node *p = to->tail;
node *q = l->head;