From 9045840e3384d99c692794c47d41e0e99d4cf1e8 Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Sun, 17 Mar 2024 19:35:28 +0100 Subject: [PATCH] AK: Use correct wide integer type for qhat check in UFixedBigIntDivision Previously, we were assuming that were always on a 64-bit platform, which is not 100% correct --- AK/UFixedBigIntDivision.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/UFixedBigIntDivision.h b/AK/UFixedBigIntDivision.h index 171f9a44ef6..398a93ffbc0 100644 --- a/AK/UFixedBigIntDivision.h +++ b/AK/UFixedBigIntDivision.h @@ -95,7 +95,7 @@ constexpr void div_mod_internal( qhat = div_mod_words(dividend[i - 1], dividend[i], divisor_approx, rhat); auto is_qhat_too_large = [&] { - return UFixedBigInt { qhat }.wide_multiply(divisor[divisor_len - 2]) > u128 { dividend[i - 2], rhat }; + return UFixedBigInt { qhat }.wide_multiply(divisor[divisor_len - 2]) > UFixedBigInt { dividend[i - 2], rhat }; }; if (is_qhat_too_large()) { --qhat;