Skip to content

ext/gmp: gmp_fact() reject values larger than unsigned long.#21794

Open
devnexen wants to merge 1 commit intophp:masterfrom
devnexen:gmp_fix_1
Open

ext/gmp: gmp_fact() reject values larger than unsigned long.#21794
devnexen wants to merge 1 commit intophp:masterfrom
devnexen:gmp_fix_1

Conversation

@devnexen
Copy link
Copy Markdown
Member

No description provided.

@devnexen devnexen marked this pull request as ready for review April 18, 2026 06:54
@devnexen devnexen requested a review from Girgias as a code owner April 18, 2026 06:54
Comment thread ext/gmp/gmp.c
}

// TODO: Check that we don't an int that is larger than an unsigned long?
// Could use mpz_fits_slong_p() if we revert to using mpz_get_si()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment shouldn't be deleted (?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO is resolved by the new check right below — mpz_fits_ulong_p(gmpnum) is exactly what it was asking for. Keeping the comment would misleadingly suggest the
work is still pending. But wiating fairly Gina's opinion on it first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants