Fix getBits Bug when wanted bit is last bit, w/ T
This commit is contained in:
parent
b19649192a
commit
900091f798
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user