summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d44860c)
raw | patch | inline | side by side (parent: d44860c)
author | Florian Forster <octo@collectd.org> | |
Wed, 17 Jun 2015 20:08:19 +0000 (22:08 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 17 Jun 2015 20:09:14 +0000 (22:09 +0200) |
clang's static code analysis thought that x->right / x->left could be NULL,
reporting false positives. Let's see if this fixes it.
reporting false positives. Let's see if this fixes it.
src/utils_avltree.c | patch | blob | history |
diff --git a/src/utils_avltree.c b/src/utils_avltree.c
index 6a25fb57657104470a1f18fdf7d008f94e830fd6..ecaf3c915967b2daee20489b9d8aa02aa41e6de6 100644 (file)
--- a/src/utils_avltree.c
+++ b/src/utils_avltree.c
c_avl_node_t *y;
c_avl_node_t *b;
+ assert (x != NULL);
+ assert (x->left != NULL);
+
p = x->parent;
y = x->left;
b = y->right;
y->height = calc_height (y);
return (y);
-} /* void rotate_left */
+} /* void rotate_right */
/*
* (x) (y)
c_avl_node_t *y;
c_avl_node_t *b;
+ assert (x != NULL);
+ assert (x->right != NULL);
+
p = x->parent;
y = x->right;
b = y->left;