Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.

numpy/_core/fromnumeric.py Outdated Show resolved Hide resolved
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 09 - Backport-Candidate PRs tagged should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: SystemError when calling numpy.resize with unsigned integer size
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.