From 8801c4fc0dbd70632d247a9f5bb5314ef6a61b1e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 21 Jan 2018 15:52:51 +0000 Subject: [PATCH] Avoid shift of negative, which is undefined in C. --- src/microcode/bignmint.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microcode/bignmint.h b/src/microcode/bignmint.h index d1c3c02cc..8f9d904a5 100644 --- a/src/microcode/bignmint.h +++ b/src/microcode/bignmint.h @@ -118,7 +118,8 @@ extern void abort (); ((BIGNUM_RADIX / BIGNUM_DIGIT_LENGTH) - BIGNUM_DIGIT_LENGTH) #define BIGNUM_DIGIT(c) ((bignum_digit_type) (c)) -#define BIGNUM_DIGIT_ONES(n) (~ ((~ (BIGNUM_DIGIT (0))) << (n))) +#define BIGNUM_DIGIT_ONES(n) \ + ((bignum_digit_type) (~ ((~ ((uintmax_t) (0))) << (n)))) #define BIGNUM_START_PTR(bignum) \ ((BIGNUM_TO_POINTER (bignum)) + 1) -- 2.25.1