die-github-die 2 months ago committed by GitHub
commit 0569e9457d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -183,10 +183,8 @@ bool overflow_check_u64_add (const u64 a, const u64 b)
bool overflow_check_u64_mul (const u64 a, const u64 b) bool overflow_check_u64_mul (const u64 a, const u64 b)
{ {
const int a_msb = get_msb64 (a); u64 c = a * b;
const int b_msb = get_msb64 (b); return c / a == b;
return ((a_msb + b_msb) < 64);
} }
bool is_power_of_2 (const u32 v) bool is_power_of_2 (const u32 v)

Loading…
Cancel
Save