Skip to content

Commit 511dc89

Browse files
committed
BUG: avoid incorrect type punning in NpyString_acquire_allocators
1 parent 80a21e7 commit 511dc89

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

numpy/_core/src/highway

Submodule highway updated 125 files

numpy/_core/src/multiarray/stringdtype/static_string.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ NpyString_acquire_allocators(size_t n_descriptors,
328328
}
329329
int allocators_match = 0;
330330
for (size_t j=0; j<i; j++) {
331+
if (allocators[j] == NULL) {
332+
continue;
333+
}
331334
if (((PyArray_StringDTypeObject *)descrs[i])->allocator ==
332335
((PyArray_StringDTypeObject *)descrs[j])->allocator)
333336
{

0 commit comments

Comments
 (0)