mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1532867 - Force unsigned arithmetic. r=gerald
"For negative a, the behavior of a << b is undefined." https://en.cppreference.com/w/cpp/language/operator_arithmetic Differential Revision: https://phabricator.services.mozilla.com/D29459 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
da336c5aa4
commit
703b321635
@ -37,7 +37,7 @@ void BitWriter::WriteBits(uint64_t aValue, size_t aBits) {
|
||||
mBuffer->AppendElement(0);
|
||||
}
|
||||
|
||||
const uint8_t clearMask = ~(~0 << (8 - mBitIndex));
|
||||
const uint8_t clearMask = ~(~0u << (8 - mBitIndex));
|
||||
uint8_t mask = 0;
|
||||
|
||||
if (mBitIndex + aBits > 8) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user