[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 919e1b81a4a 11/16: Pacify GCC 13 -Wnull-dereference in itree.c
From: |
Paul Eggert |
Subject: |
master 919e1b81a4a 11/16: Pacify GCC 13 -Wnull-dereference in itree.c |
Date: |
Sun, 14 May 2023 22:28:25 -0400 (EDT) |
branch: master
commit 919e1b81a4a8ff95c36a0639fa5a5c86f8759f2e
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Pacify GCC 13 -Wnull-dereference in itree.c
* src/itree.c (itree_remove_fix): Simplify code and remove a
couple of eassume calls. This works around GCC bug 109586.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109856
---
src/itree.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/itree.c b/src/itree.c
index bd3e62a374a..ecf7d67422a 100644
--- a/src/itree.c
+++ b/src/itree.c
@@ -817,14 +817,13 @@ itree_remove_fix (struct itree_tree *tree,
{
struct itree_node *other = parent->right;
- if (null_safe_is_red (other)) /* case 1.a */
+ if (other->red) /* case 1.a */
{
other->red = false;
parent->red = true;
itree_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))
@@ -855,14 +854,13 @@ itree_remove_fix (struct itree_tree *tree,
{
struct itree_node *other = parent->left;
- if (null_safe_is_red (other)) /* 1.b */
+ if (other->red) /* 1.b */
{
other->red = false;
parent->red = true;
itree_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))
- master updated (e7dc30c1d58 -> ebf5e4ca1cd), Paul Eggert, 2023/05/14
- master b77d357ea35 01/16: Update from Gnulib by running admin/merge-gnulib, Paul Eggert, 2023/05/14
- master 8c0671b9cbf 02/16: Avoid duplicate configure-time codeset tests, Paul Eggert, 2023/05/14
- master 3e3f34d71e9 03/16: Fix ebrowse -f buffer overflow, Paul Eggert, 2023/05/14
- master 92d4bda2797 04/16: Fix movemail fd leak, Paul Eggert, 2023/05/14
- master 0c11c2ae71f 10/16: Pacify GCC 13 -Wanalyzer-out-of-bounds, Paul Eggert, 2023/05/14
- master 85c4efc9f41 14/16: Prefer UINTMAX_WIDTH in print_object, Paul Eggert, 2023/05/14
- master 919e1b81a4a 11/16: Pacify GCC 13 -Wnull-dereference in itree.c,
Paul Eggert <=
- master 67ee74f8e55 05/16: Pacify GCC 13 -fanalyzer in tty_menu_activate, Paul Eggert, 2023/05/14
- master 0b9677a192b 07/16: Work around GCC bug 109579 in ccl.c, Paul Eggert, 2023/05/14
- master 0f5b1fcdf0b 13/16: Help GCC compute modiff_incr, Paul Eggert, 2023/05/14
- master 7166737b5c9 06/16: Work around GCC bug 109577, Paul Eggert, 2023/05/14
- master 9eef5a678c3 08/16: Do not use -Wanalyzer-fd-leak, Paul Eggert, 2023/05/14
- master 4fedd5af4cc 09/16: Work around GCC bug 109847 in buffer.c, Paul Eggert, 2023/05/14
- master 3cd8ce87d29 12/16: Work after 2038 on 32-bit GNU/Linux, Paul Eggert, 2023/05/14
- master 9f8a5989b65 15/16: Prefer PTRDIFF_WIDTH in sort.c, Paul Eggert, 2023/05/14
- master ebf5e4ca1cd 16/16: Prefer _WIDTH macros to sizeof in pdumper.c, Paul Eggert, 2023/05/14