diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-08-31 15:43:48 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-08-31 15:43:48 +0000 |
commit | ebd52382c6dcfcbe17a13cb5c3c26199d2f8613c (patch) | |
tree | 97d63a7ecf105aa5832d1a8e11428123f77f9dc3 | |
parent | abb0374b7f05425910d7e770a85e794c955dad35 (diff) | |
download | mpfr-ebd52382c6dcfcbe17a13cb5c3c26199d2f8613c.tar.gz |
[src/mpfr-mini-gmp.c] Fixed potential undefined behavior (when mp_limb_t
is defined as an unsigned short) with MPFR_LIMB_LSHIFT.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13102 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/mpfr-mini-gmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mpfr-mini-gmp.c b/src/mpfr-mini-gmp.c index d397f0d40..70677dcfa 100644 --- a/src/mpfr-mini-gmp.c +++ b/src/mpfr-mini-gmp.c @@ -87,7 +87,7 @@ mpz_urandomb (mpz_t rop, gmp_randstate_t state, mp_bitcnt_t nbits) i = n * GMP_NUMB_BITS - nbits; /* mask the upper i bits */ if (i) - rop->_mp_d[n-1] = MPFR_LIMB(rop->_mp_d[n-1] << i) >> i; + rop->_mp_d[n-1] = MPFR_LIMB_LSHIFT(rop->_mp_d[n-1], i) >> i; while (n > 0 && (rop->_mp_d[n-1] == 0)) n--; rop->_mp_size = n; |