Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: avoid negating unsigned integers in resize implementation #29230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2025

Conversation

ngoldbaum
Copy link
Member

@ngoldbaum ngoldbaum commented Jun 18, 2025

Fixes #29225.

The negation of an unsigned int underflows and creates a large positive repeats, which leads to allocations failures and/or swapping.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Jun 19, 2025
@seberg
Copy link
Member

seberg commented Jun 19, 2025

Looks good, thanks. (Another fix might be to call operator.index() to broaden to support all integers, but even then I prefer this spelling for the division.)

@seberg seberg merged commit 7a74e12 into numpy:main Jun 19, 2025
76 checks passed
charris pushed a commit to charris/numpy that referenced this pull request Jun 19, 2025
…#29230)

The negation of an unsigned int underflows and creates a large positive repeats, which leads to allocations failures and/or swapping.
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jun 19, 2025
charris added a commit that referenced this pull request Jun 19, 2025
BUG: avoid negating unsigned integers in resize implementation (#29230)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: SystemError when calling numpy.resize with unsigned integer size
4 participants