1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibCrypto: Replace use of negate() in SignedBigInteger::bitwise_or

Calling negate() on a big integer does not make it negative, but
rather flips its sign, so this was not actually acting as an OR.
This commit is contained in:
Gal Horowitz 2021-06-30 20:36:08 +03:00 committed by Andreas Kling
parent 3f5c9d3edb
commit 38e9e35380

View file

@ -156,8 +156,7 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_or(const SignedBigInteger& ot
auto result = bitwise_or(other.unsigned_value());
// The sign bit will have to be OR'd manually.
if (other.is_negative())
result.negate();
result.m_sign = is_negative() || other.is_negative();
return result;
}