aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-08-17 14:03:47 +0200
committerMaria Matejka <mq@ucw.cz>2020-05-01 15:19:12 +0200
commite26a5195dd6c62e6f4b80d13b6ecd5f40ee68546 (patch)
treeee429383d0ca6d6b38a682e49e6e40fdf3a363d5 /lib
parent3bb10b4d31d68a8139e284c27f7eb6fca897721d (diff)
downloadbird-e26a5195dd6c62e6f4b80d13b6ecd5f40ee68546.tar.gz
Lists: fix a stupid sanitizer bug
Diffstat (limited to 'lib')
-rw-r--r--lib/lists.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/lists.c b/lib/lists.c
index c162a991..8553ee27 100644
--- a/lib/lists.c
+++ b/lib/lists.c
@@ -167,8 +167,12 @@ LIST_INLINE void
replace_node(node *old, node *new)
{
EXPENSIVE_CHECK(check_list(NULL, old));
- ASSUME(new->prev == NULL);
- ASSUME(new->next == NULL);
+
+ if (old != new)
+ {
+ ASSUME(new->prev == NULL);
+ ASSUME(new->next == NULL);
+ }
old->next->prev = new;
old->prev->next = new;