]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compiler warning about possible null pointer dereference
authorMatt Armstrong <matt@rfc20.org>
Sun, 23 Oct 2022 15:58:00 +0000 (08:58 -0700)
committerMatt Armstrong <matt@rfc20.org>
Sun, 23 Oct 2022 16:00:01 +0000 (09:00 -0700)
* src/itree.c (interval_tree_remove_fix): Use 'eassert' to both check
for non-null and suppress a compiler warning.

src/itree.c

index 501226b7e28afaaf55c2e271983f7ff1766a7ee4..e824f2c89145956cd1cda0ac603f7ae2d2995577 100644 (file)
@@ -919,6 +919,7 @@ interval_tree_remove_fix (struct itree_tree *tree,
              interval_tree_rotate_left (tree, parent);
              other = parent->right;
             }
+          eassume (other != NULL);
 
           if (null_safe_is_black (other->left) /* 2.a */
               && null_safe_is_black (other->right))
@@ -956,6 +957,7 @@ interval_tree_remove_fix (struct itree_tree *tree,
              interval_tree_rotate_right (tree, parent);
              other = parent->left;
             }
+          eassume (other != NULL);
 
           if (null_safe_is_black (other->right) /* 2.b */
               && null_safe_is_black (other->left))