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:
Jean-Yves Avenard 2019-05-01 07:20:23 +00:00
parent da336c5aa4
commit 703b321635

View File

@ -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) {