diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-05-31 06:41:53 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-05-31 06:41:53 +0200 |
commit | 0828c9aebcab65cca4ba1d984b679b00f822ed8a (patch) | |
tree | 266d8ae9774f928b4d4aca290fe31faf355e0111 /mpz/scan1.c | |
parent | 87760c11c9711216794e34ee7df5e1c4234d3d5d (diff) | |
download | gmp-0828c9aebcab65cca4ba1d984b679b00f822ed8a.tar.gz |
Acoid calling mpn_zero_p with zero size.
Diffstat (limited to 'mpz/scan1.c')
-rw-r--r-- | mpz/scan1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mpz/scan1.c b/mpz/scan1.c index c9309de69..0ea50c3fd 100644 --- a/mpz/scan1.c +++ b/mpz/scan1.c @@ -90,7 +90,7 @@ mpz_scan1 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW { /* If there's a non-zero limb before ours then we're in the ones complement region. */ - if (mpn_zero_p (u_ptr, starting_limb)) { + if (starting_limb == 0 || mpn_zero_p (u_ptr, starting_limb)) { if (limb == 0) /* Seeking for the first non-zero bit, it is the same for u and -u. */ goto search_nonzero; |