summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-13 13:03:53 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-13 13:03:53 +0000
commit1971c527e82c9a594dd34c30d48449df2bf0e36b (patch)
treecded5f9a9927faa36455952e2eb044424052dd50
parentfe31c0c5ed846ca2f9ba28adc3ed2ace136f2d6b (diff)
downloadmpfr-1971c527e82c9a594dd34c30d48449df2bf0e36b.tar.gz
[src/get_ui.c] Added assertions.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13186 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/get_ui.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/get_ui.c b/src/get_ui.c
index e7c73fe8d..359113625 100644
--- a/src/get_ui.c
+++ b/src/get_ui.c
@@ -66,11 +66,13 @@ mpfr_get_ui (mpfr_srcptr f, mpfr_rnd_t rnd)
#else
while (exp > GMP_NUMB_BITS)
{
+ MPFR_ASSERTD (n > 0);
s += (unsigned long) MPFR_MANT(x)[n - 1] << (exp - GMP_NUMB_BITS);
n--;
exp -= GMP_NUMB_BITS;
}
#endif
+ MPFR_ASSERTD (n > 0);
s += MPFR_MANT(x)[n - 1] >> (GMP_NUMB_BITS - exp);
}