From 08a13204b79d8920625f07fcd4a99b554d918a6f Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 17 Nov 2020 08:22:13 +0100 Subject: [PATCH] bitset: fix iteration over table bitsets * lib/bitset/table.c (tbitset_list): Update bitno when windex is. --- ChangeLog | 5 +++++ lib/bitset/table.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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! */ -- 2.39.5