summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-01-12 14:52:26 +0100
committerJim Meyering <meyering@redhat.com>2012-01-13 12:06:56 +0100
commit78e365574efd56c38af39d50fc8a5017323e00a3 (patch)
tree72c964189059e36bdc551fe08782cb0578adf665
parent3ca445da2582ecfeb4e71e6bdbcee815a656eecc (diff)
downloadbison-78e365574efd56c38af39d50fc8a5017323e00a3.tar.gz
build: avoid warning from coverity about lbitset_elt_find
* lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt", at a point where we know it is non-NULL, due to prior dereference. Copyright (C) 1987-1988, 1991-2012 Free Software Foundation,
-rw-r--r--ChangeLog6
-rw-r--r--lib/lbitset.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ad1c332..70f113f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-12 Jim Meyering <meyering@redhat.com>
+
+ build: avoid warning from coverity about lbitset_elt_find
+ * lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt",
+ at a point where we know it is non-NULL, due to prior dereference.
+
2012-01-13 Jim Meyering <meyering@redhat.com>
maint: get fdl.texi from gnulib
diff --git a/lib/lbitset.c b/lib/lbitset.c
index 261374c7..ef7e216d 100644
--- a/lib/lbitset.c
+++ b/lib/lbitset.c
@@ -1,7 +1,6 @@
/* Functions to support link list bitsets.
- Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation,
- Inc.
+ Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
@@ -352,7 +351,7 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
/* ELT is the nearest to the one we want. If it's not the one
we want, the one we want does not exist. */
- if (elt && (windex - elt->index) < LBITSET_ELT_WORDS)
+ if (windex - elt->index < LBITSET_ELT_WORDS)
{
bset->b.cindex = elt->index;
bset->b.csize = LBITSET_ELT_WORDS;