From: Akim Demaille Date: Tue, 17 Nov 2020 07:22:13 +0000 (+0100) Subject: bitset: fix iteration over table bitsets X-Git-Tag: v1.0~3496 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=08a13204b79d8920625f07fcd4a99b554d918a6f;p=gnulib.git bitset: fix iteration over table bitsets * lib/bitset/table.c (tbitset_list): Update bitno when windex is. --- diff --git a/ChangeLog b/ChangeLog index 0f85db66b3..1e68878cdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-11-17 Akim Demaille + + bitset: fix iteration over table bitsets + * lib/bitset/table.c (tbitset_list): Update bitno when windex is. + 2020-11-17 Akim Demaille bitset: rename internal details for consistency diff --git a/lib/bitset/table.c b/lib/bitset/table.c index b762f5951e..d111e02037 100644 --- a/lib/bitset/table.c +++ b/lib/bitset/table.c @@ -649,15 +649,16 @@ tbitset_list (bitset bset, bitset_bindex *list, for (; eindex < size; eindex++) { - bitset_word *srcp; tbitset_elt *elt = elts[eindex]; if (!elt) continue; - srcp = TBITSET_WORDS (elt); + bitset_word *srcp = TBITSET_WORDS (elt); bitset_windex windex = eindex * TBITSET_ELT_WORDS; + bitno = windex * BITSET_WORD_BITS; + /* Is there enough room to avoid checking in each iteration? */ if ((count + TBITSET_ELT_BITS) < num) { /* The coast is clear, plant boot! */