We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99a1b5c commit 140794cCopy full SHA for 140794c
src/Utilities/Util.h
@@ -51,7 +51,7 @@ template <typename T>
51
void setBits(T& bits, int index, int width, uint32_t value)
52
{
53
uint32_t mask = ~(~T(0)<<width) << index;
54
- bits = (bits & ~mask) | (value << index);
+ bits = (bits & ~mask) | ((value << index) & mask);
55
}
56
57
template <typename T>
0 commit comments