mpn_mul_2 doesn't do size=1

This commit is contained in:
jasonmoxham 2009-04-22 22:05:08 +00:00
parent a2baca61f0
commit b52aa5a59e
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ mult (mpz_srcptr u, mpz_srcptr v, mpz_ptr w)
}
#if HAVE_NATIVE_mpn_mul_2
if (vsize <= 2)
if (vsize <= 2 && usize >= vsize)
{
MPZ_REALLOC (w, usize+vsize);
wp = PTR(w);

View File

@ -833,7 +833,7 @@ refmpn_mul_2 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_srcptr mult)
ASSERT (refmpn_overlap_fullonly_p (dst, src, size));
ASSERT (! refmpn_overlap_p (dst, size+1, mult, (mp_size_t) 2));
ASSERT (size >= 1);
ASSERT (size >= 2);
ASSERT_MPN (mult, 2);
/* in case dst==src */