From cd727452b9430387afa640e64d2ff23510e161e6 Mon Sep 17 00:00:00 2001 From: Daniel Grund Date: Wed, 10 Aug 2005 13:06:23 +0000 Subject: [PATCH] Bugfix in mask highest. [r6387] --- ir/adt/bitset.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ir/adt/bitset.h b/ir/adt/bitset.h index 4f249be07..d16d44955 100644 --- a/ir/adt/bitset.h +++ b/ir/adt/bitset.h @@ -73,8 +73,10 @@ static INLINE bitset_t *_bitset_prepare(void *area, bitset_pos_t size) */ static INLINE bitset_t *_bitset_mask_highest(bitset_t *bs) { - bs->data[bs->units - 1] &= (1 << (bs->size & BS_UNIT_MASK)) - 1; - return bs; + bitset_pos_t rest = bs->size & BS_UNIT_MASK; + if (rest) + bs->data[bs->units - 1] &= (1 << rest) - 1; + return bs; } /** -- 2.20.1