summaryrefslogtreecommitdiff
path: root/src/urandom.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-06 13:38:53 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-06 13:38:53 +0000
commitbd01307f8e3295e4940af66288ee2c991ed68821 (patch)
tree37617e91cf17ec26d4280a72f72c07640dbce4af /src/urandom.c
parent6f9746c295a973277b6dea823d811ac930ad3a4b (diff)
downloadmpfr-bd01307f8e3295e4940af66288ee2c991ed68821.tar.gz
[src/urandom.c] Fixed uninitialized emin for nbits == 1
(thanks GCC's -Werror=maybe-uninitialized). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10581 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/urandom.c')
-rw-r--r--src/urandom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/urandom.c b/src/urandom.c
index 9978a2f7a..7254cc0f0 100644
--- a/src/urandom.c
+++ b/src/urandom.c
@@ -53,6 +53,8 @@ mpfr_urandom (mpfr_ptr rop, gmp_randstate_t rstate, mpfr_rnd_t rnd_mode)
rp = MPFR_MANT (rop);
nbits = MPFR_PREC (rop);
+ emin = mpfr_get_emin ();
+
/* special code for nbits = 1 */
if (nbits == 1)
{
@@ -71,7 +73,6 @@ mpfr_urandom (mpfr_ptr rop, gmp_randstate_t rstate, mpfr_rnd_t rnd_mode)
nlimbs = MPFR_LIMB_SIZE (rop);
MPFR_SET_POS (rop);
exp = 0;
- emin = mpfr_get_emin ();
if (MPFR_UNLIKELY (emin > 0))
{
if (rnd_mode == MPFR_RNDU || rnd_mode == MPFR_RNDA