diff --git a/Utilities/BitField.h b/Utilities/BitField.h index 754982c350..ec3390a391 100644 --- a/Utilities/BitField.h +++ b/Utilities/BitField.h @@ -147,7 +147,7 @@ struct bf_t : bf_base bf_t& operator &=(vtype right) { - this->m_data &= static_cast((static_cast(right) & bf_t::vmask) << bitpos); + this->m_data &= static_cast(((static_cast(right) & bf_t::vmask) << bitpos) | ~(bf_t::vmask << bitpos)); return *this; }