mpz_gcd_ui(NULL, ...) with small limbs

Marco Bodrato bodrato at mail.dm.unipi.it
Mon Jan 31 22:46:07 CET 2022


Ciao,

Il Sab, 22 Gennaio 2022 11:40 pm, Marc Glisse ha scritto:
> mpz_gcd_ui also contains special code for the case
> where op2 (an unsigned long) does not fit in a limb. And that code calls
> mpz_gcd without checking if the first argument is NULL. That probably does
> not affect any platform, since nails are not supported and I don't see

Keeping unused code error-free is not easy, because it is not tested...
But I think we should always correct it, when we run into a possible
issue.
The alternative, IMO, is to remove the unused_and_incorrect code.

Yet another 2-limbs array, and dummy allocation are needed, I believe.

Ĝis,
m



More information about the gmp-bugs mailing list