]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Lists: fix a stupid sanitizer bug
authorMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 12:03:47 +0000 (14:03 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 1 May 2020 13:19:12 +0000 (15:19 +0200)
lib/lists.c

index c162a991cd4ac46a5ca09b02a24a3e81c0dc3cf7..8553ee27ee0b5f5ac234d7eda862fa75c7166858 100644 (file)
@@ -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;