Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ioctl_tree: Quiesce analyzer false positive
It claims that ``` src/ioctl_tree.c:305:17: error: check of ‘node’ for NULL after already dereferencing it [-Werror=analyzer-deref-before-chec k] 305 | for (; node != NULL; node = node->parent) | ^ ‘ioctl_tree_next’: events 1-4 | | 300 | if (node->child != NULL) | | ~~~~~^~~~~~~ | | | | | | | (1) pointer ‘node’ is dereferenced here | | (2) following ‘false’ branch... | 301 | return node->child; | 302 | if (node->next != NULL) | | ~~~~~~~~~~~ | | | | | | | (3) ...to here | | (4) following ‘false’ branch... | ‘ioctl_tree_next’: event 5 | |cc1: | (5): ...to here | ‘ioctl_tree_next’: event 6 | | 305 | for (; node != NULL; node = node->parent) | | ^ | | | | | (6) pointer ‘node’ is checked for NULL here but it was already dereferenced at (1) ``` But this is bogus -- the for loop first moves node to node->parent and then checks against NULL. The same happens when rewriting it as a while loop.
- Loading branch information