Skip to content
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

BUG: Fix setstate logic for empty arrays #20681

Merged
merged 3 commits into from Dec 30, 2021

Conversation

charris
Copy link
Member

@charris charris commented Dec 30, 2021

Backport of #20954.

Also cleans up the clearing of the mem_handler slightly. Lets try
to make sure it is always NULL when OWNDATA is not set (and an error
is given), just so there can't be any accidental double-frees.

Obviously, this function has more problems then the ones fixed here...

This introduces the NBYTES_ALLOCATED helper basically just for these
two places to fix the UHOH prints also...

seberg added 3 commits Dec 30, 2021
Also cleans up the clearing of the mem_handler slightly.  Lets try
to make sure it is always NULL when OWNDATA is not set (and an error
is given), just so there can't be any accidental double-frees.

Obviously, this function has more problems then the ones fixed here...

This introduces the NBYTES_ALLOCATED helper basically just for these
two places to fix the UHOH prints also...
@charris charris added this to the 1.22.0 release milestone Dec 30, 2021
@charris charris merged commit 5399c03 into numpy:maintenance/1.22.x Dec 30, 2021
36 checks passed
@charris charris deleted the backport-20954 branch Dec 30, 2021
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.

None yet

2 participants