* sbitmap.c (sbitmap_ones): Don't set too many bits.

From-SVN: r29807
This commit is contained in:
Richard Henderson 1999-10-04 11:39:19 -07:00
parent 4afd525437
commit 393f3ad5b9

View File

@ -115,7 +115,16 @@ void
sbitmap_ones (bmap)
sbitmap bmap;
{
unsigned int last_bit;
memset (bmap->elms, -1, bmap->bytes);
last_bit = bmap->n_bits % (unsigned) SBITMAP_ELT_BITS;
if (last_bit)
{
bmap->elms[bmap->size - 1]
= (SBITMAP_ELT_TYPE)-1 >> (SBITMAP_ELT_BITS - last_bit);
}
}
/* Zero a vector of N_VECS bitmaps. */
@ -208,7 +217,7 @@ sbitmap_difference (dst, a, b)
*dstp++ = *ap++ & (~*bp++);
}
/* Set DST to be (A and B)).
/* Set DST to be (A and B).
Return non-zero if any change is made. */
int