summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-01-18 08:46:42 -0500
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-01-18 20:04:06 +0330
commit013799a4dd303653aead72f1b35c6d96767abc94 (patch)
treec7838bf6fd9577284fb72c7ea8c5d3d4db790ff6 /Userland/Utilities
parent1f9863939641793f823bd872b24d26e2df2e8e1e (diff)
downloadserenity-013799a4dd303653aead72f1b35c6d96767abc94.zip
LibCrypto+LibJS: Better bigint bitwise_or binop
Similar to the bitwise_and change, but we have to be careful to sign-extend two's complement numbers only up to the highest set bit in the positive number.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/test-crypto.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Utilities/test-crypto.cpp b/Userland/Utilities/test-crypto.cpp
index 178383e6ae..ee5d2d4d71 100644
--- a/Userland/Utilities/test-crypto.cpp
+++ b/Userland/Utilities/test-crypto.cpp
@@ -2996,7 +2996,7 @@ static void bigint_signed_bitwise()
I_TEST((Signed BigInteger | Bitwise or handles sign));
auto num1 = "-1234567"_sbigint;
auto num2 = "1234567"_sbigint;
- if (num1.bitwise_or(num2) == num1) {
+ if (num1.bitwise_or(num2) == "-1"_sbigint) {
PASS;
} else {
FAIL(Invalid value);