aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2023-02-12 16:38:27 -0500
committerBrian Behlendorf <[email protected]>2023-03-08 13:51:21 -0800
commita4240a8ac7871f8de537edf799e37e0a4fd4be08 (patch)
treefa8b3ffa1bfaef0757957992aef69a5c3bad29d9 /module
parent8b72dfed11d0070c55361408bff9d60d873e437f (diff)
Suppress Clang Static Analyzer false positive in the AVL tree code.
This has been filed as llvm/llvm-project#60694. Switching from a copy through a C pointer dereference to an explicit memcpy() is a workaround that prevents a false positive. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #14575
Diffstat (limited to 'module')
-rw-r--r--module/avl/avl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/avl/avl.c b/module/avl/avl.c
index b788ed28a..9b74531fa 100644
--- a/module/avl/avl.c
+++ b/module/avl/avl.c
@@ -108,6 +108,10 @@
#include <sys/cmn_err.h>
#include <sys/mod.h>
+#ifndef _KERNEL
+#include <string.h>
+#endif
+
/*
* Walk from one node to the previous valued node (ie. an infix walk
* towards the left). At any given node we do one of 2 things:
@@ -695,7 +699,7 @@ avl_remove(avl_tree_t *tree, void *data)
*/
tmp = *node;
- *node = *delete;
+ memcpy(node, delete, sizeof (*node));
if (node->avl_child[left] == node)
node->avl_child[left] = &tmp;