summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/tests/fast_idiv_by_const/fast_idiv_by_const_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/tests/fast_idiv_by_const/fast_idiv_by_const_test.cpp b/src/util/tests/fast_idiv_by_const/fast_idiv_by_const_test.cpp
index 222346230e4..330f90fa464 100644
--- a/src/util/tests/fast_idiv_by_const/fast_idiv_by_const_test.cpp
+++ b/src/util/tests/fast_idiv_by_const/fast_idiv_by_const_test.cpp
@@ -230,7 +230,7 @@ rand_sint(unsigned bits, unsigned min_abs)
{
/* Make sure we hit MIN_INT every once in a while */
if (rand() % 64 == 37)
- return -(1 << (bits - 1));
+ return INT64_MIN >> (64 - bits);
int64_t s = rand_uint(bits - 1, min_abs);
return rand() & 1 ? s : -s;
@@ -306,7 +306,7 @@ random_sdiv_test(unsigned bits)
int64_t d;
do {
d = rand_sint(bits, 2);
- } while (util_is_power_of_two_or_zero64(llabs(d)));
+ } while (d == INT64_MIN || util_is_power_of_two_or_zero64(llabs(d)));
assert(sint_is_in_range(n, bits));
assert(sint_is_in_range(d, bits) && llabs(d) >= 2);