From b3a31b69eeb473e7ff9e18fd9db8719478611011 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 10 Apr 2024 12:28:48 +0200 Subject: [PATCH] util/RedBlackTree: fix lost "right" child while swapping with successor Fixes a tree corruption bug that led to assertion failures. --- src/util/RedBlackTree.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/RedBlackTree.hxx b/src/util/RedBlackTree.hxx index 2cffb156f..73d1c35af 100644 --- a/src/util/RedBlackTree.hxx +++ b/src/util/RedBlackTree.hxx @@ -289,6 +289,7 @@ public: assert(successor.parent != this); successor.parent->SetChild(Direction::LEFT, *this); + successor.SetChild(Direction::RIGHT, &right); } p.SetChild(direction_in_parent, successor);