Skip to content

BUG: Fix PyArray_ZeroContiguousBuffer (resize) with struct dtypes#27226

Merged
mattip merged 1 commit intonumpy:mainfrom
seberg:issue-27225
Aug 16, 2024
Merged

BUG: Fix PyArray_ZeroContiguousBuffer (resize) with struct dtypes#27226
mattip merged 1 commit intonumpy:mainfrom
seberg:issue-27225

Conversation

@seberg
Copy link
Member

@seberg seberg commented Aug 16, 2024

We allow the structured dtype to return NULL for the zero fill function to indicate that a simple memset is sufficient.

Also simplifies error handling a bit. The get_fill_zero_loop function must clean up on error and not return references if returns a NULL loop.

Closes gh-27225

EDIT: Sorry, forgot about the times. This needs to be backported to 2.1.

We allow the structured dtype to return NULL for the zero fill
function to indicate that a simple memset is sufficient.

Also simplifies error handling a bit.  The get_fill_zero_loop
function must clean up on error and not return references if
returns a `NULL` loop.
@seberg seberg added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported and removed 09 - Backport-Candidate PRs tagged should be backported labels Aug 16, 2024
@seberg seberg requested a review from ngoldbaum August 16, 2024 09:22
@mattip mattip merged commit 8da7490 into numpy:main Aug 16, 2024
@mattip
Copy link
Member

mattip commented Aug 16, 2024

Thanks @seberg

@seberg seberg deleted the issue-27225 branch August 16, 2024 11:28
@ngoldbaum
Copy link
Member

Thanks for the quick fix and merge!

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: resize causes segfault in case of arreys with structured dtype

4 participants