[Gmp-commit] /var/hg/gmp: mpn/generic/sqrtrem.c: disallow zero size

mercurial at gmplib.org mercurial at gmplib.org
Mon Jun 29 05:04:16 UTC 2015


details:   /var/hg/gmp/rev/c55534b5d5aa
changeset: 16728:c55534b5d5aa
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Jun 29 07:04:04 2015 +0200
description:
mpn/generic/sqrtrem.c: disallow zero size

diffstat:

 mpn/generic/sqrtrem.c |  6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diffs (18 lines):

diff -r 703184c711d0 -r c55534b5d5aa mpn/generic/sqrtrem.c
--- a/mpn/generic/sqrtrem.c	Wed Jun 24 18:31:39 2015 +0200
+++ b/mpn/generic/sqrtrem.c	Mon Jun 29 07:04:04 2015 +0200
@@ -272,13 +272,9 @@
   mp_size_t rn, tn;
   TMP_DECL;
 
-  ASSERT (nn >= 0);
+  ASSERT (nn > 0);
   ASSERT_MPN (np, nn);
 
-  /* If OP is zero, both results are zero.  */
-  if (nn == 0)
-    return 0;
-
   ASSERT (np[nn - 1] != 0);
   ASSERT (rp == NULL || MPN_SAME_OR_SEPARATE_P (np, rp, nn));
   ASSERT (rp == NULL || ! MPN_OVERLAP_P (sp, (nn + 1) / 2, rp, nn));


More information about the gmp-commit mailing list