Fix getBits Bug when wanted bit is last bit, w/ T

This commit is contained in:
sBubshait 2024-06-03 21:47:14 +01:00
parent b19649192a
commit 900091f798

View File

@ -11,7 +11,7 @@ static word getBits(word wrd, uint8_t lsb, uint8_t msb) {
// Ensure LSB and MSB are within range of word size, and in the correct order
assert(lsb < msb && msb <= WORD_BITS);
wrd &= (1 << msb) - 1;
wrd &= ((dword) 1 << msb) - 1;
return wrd >> lsb;
}