POLY: fix infinite loop for non-invertible polynomials

This commit is contained in:
hasufell 2014-06-27 22:40:08 +02:00
parent c9fcb7aa99
commit cef08a4ae0
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 6 additions and 0 deletions

View File

@ -352,6 +352,9 @@ poly_inverse_poly_q(fmpz_poly_t Fq,
goto cleanup;
}
if (fmpz_poly_is_zero(g) == 1)
goto cleanup;
if (fmpz_poly_degree(f) == 0)
break;
@ -464,6 +467,9 @@ poly_inverse_poly_p(fmpz_poly_t Fp,
goto cleanup;
}
if (fmpz_poly_is_zero(g) == 1)
goto cleanup;
if (fmpz_poly_degree(f) == 0)
break;