Add assertions in fixup
[urcu.git] / urcu-rbtree.c
index d0e6c882d6a22e37794a515cf52f114b3feb5a1f..ac55fd8768c74d180f65e7666cd533ddb1928e92 100644 (file)
@@ -37,6 +37,8 @@
 #include <urcu-rbtree.h>
 #include <urcu-pointer.h>
 
+#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;
This page took 0.023901 seconds and 4 git commands to generate.