Add assertions in fixup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Mar 2010 19:09:23 +0000 (15:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Mar 2010 19:09:23 +0000 (15:09 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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.025717 seconds and 4 git commands to generate.