add an extra overflow check

This commit is contained in:
Fredrik Johansson 2016-01-24 15:13:18 +01:00
parent 6d18eb53ed
commit a1e54756a1

View file

@ -47,7 +47,7 @@ arb_bernoulli_poly_ui(arb_t res, ulong n, const arb_t x, slong prec)
} }
/* small integer x */ /* small integer x */
if (arb_is_int(x) && arf_cmpabs_ui(arb_midref(x), n) < 0) if (arb_is_int(x) && arf_cmpabs_ui(arb_midref(x), n) < 0 && n < WORD_MAX)
{ {
if (arf_sgn(arb_midref(x)) >= 0) if (arf_sgn(arb_midref(x)) >= 0)
{ {