summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mul.c2
-rw-r--r--mulders.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/mul.c b/mul.c
index 350f2bc70..f3a861451 100644
--- a/mul.c
+++ b/mul.c
@@ -349,6 +349,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
if (MPFR_UNLIKELY (b1 == 0))
mpn_lshift (tmp, tmp, tn, 1);
+ MPFR_ASSERTD (MPFR_LIMB_MSB (tmp[tn-1]) != 0);
+
if (MPFR_UNLIKELY (!mpfr_can_round_raw (tmp, tn, sign, p + b1 - 1,
GMP_RNDN, GMP_RNDZ, MPFR_PREC(a)+(rnd_mode==GMP_RNDN))))
goto full_multiply;
diff --git a/mulders.c b/mulders.c
index 8ef66b30b..54c675dbd 100644
--- a/mulders.c
+++ b/mulders.c
@@ -51,6 +51,7 @@ mpfr_mulhigh_n (mp_ptr rp, mp_srcptr np, mp_srcptr mp, mp_size_t n)
MPFR_ASSERTD (MPFR_MULHIGH_TAB_SIZE > 4);
k = MPFR_LIKELY (n < MPFR_MULHIGH_TAB_SIZE) ? mulhigh_ktab[n] : 2*n/3;
+ MPFR_ASSERTD (k == -1 || k == 0 || (k > n/2 && k < n));
if (k < 0)
mpn_mul_basecase (rp, np, n, mp, n);
else if (k == 0)