From ba16c81feaa665a0f782b952a0c6ce435016c5e0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 22 Mar 2010 15:09:23 -0400 Subject: [PATCH] Add assertions in fixup Signed-off-by: Mathieu Desnoyers --- urcu-rbtree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/urcu-rbtree.c b/urcu-rbtree.c index d0e6c88..ac55fd8 100644 --- a/urcu-rbtree.c +++ b/urcu-rbtree.c @@ -37,6 +37,8 @@ #include #include +#define DEBUG + #ifdef DEBUG #define dbg_printf(args...) printf(args) #else @@ -526,6 +528,8 @@ static void rcu_rbtree_remove_fixup(struct rcu_rbtree_node **root, struct rcu_rbtree_node *w, *t; w = x->p->right; + assert(w != &rcu_rbtree_nil); + if (w->color == COLOR_RED) { w->color == COLOR_BLACK; x->p->color = COLOR_RED; @@ -555,6 +559,8 @@ static void rcu_rbtree_remove_fixup(struct rcu_rbtree_node **root, struct rcu_rbtree_node *w, *t; w = x->p->left; + assert(w != &rcu_rbtree_nil); + if (w->color == COLOR_RED) { w->color == COLOR_BLACK; x->p->color = COLOR_RED; -- 2.34.1