summaryrefslogtreecommitdiff
path: root/lib/lists.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lists.c')
-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;