0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-18 17:18:42 +00:00

Event list asserts to prevent running into rotten data

This commit is contained in:
Maria Matejka 2021-12-06 19:03:00 +01:00
parent e32eafaaa7
commit 4f43d326b4
2 changed files with 4 additions and 0 deletions

View File

@ -182,6 +182,7 @@ ev_run_list(event_list *l)
WALK_LIST_FIRST(n, tmp_list)
{
event *e = SKIP_BACK(event, n, n);
ASSERT_DIE(n->next->prev == n);
if (legacy)
{

View File

@ -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;