The refactoring in commit
df61c0c3a3 ("Windows: improve poll
abstraction") introduced a bug in builds where NDEBUG is defined because
of a statement with side-effects that was put inside an assertion. When
this statement is not evaluated, the file descriptor table gets corrupt.
Fix this by moving the statement outside of the assertion.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
for (n = 0; n < fd_table_size; n += BITMAP_BITS_PER_WORD) {
unsigned int idx = n / BITMAP_BITS_PER_WORD;
ULONG mask, pos = 0U;
+ unsigned char nonzero;
mask = ~fd_table_bitmap[idx];
if (mask == 0U)
continue;
- assert(_BitScanForward(&pos, mask));
+ nonzero = _BitScanForward(&pos, mask);
+ assert(nonzero);
fd_table_bitmap[idx] |= 1U << pos;
n += pos;
break;
-#define LIBUSB_NANO 11452
+#define LIBUSB_NANO 11453