mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 14:48:17 +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:
parent
3f5c9d3edb
commit
38e9e35380
Notes:
sideshowbarker
2024-07-18 11:10:51 +09:00
Author: https://github.com/GalHorowitz
Commit: 38e9e35380
Pull-request: https://github.com/SerenityOS/serenity/pull/8342
Reviewed-by: https://github.com/alimpfard
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue