Skip to content

Commit 041b2e4

Browse files
committed
Fix bug in "span" enqueue logic.
It's possible for lists or tuples to have a NULL item. Handle that in the case that all item elements fit into the buffer.
1 parent 7f51104 commit 041b2e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/gc_free_threading.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,11 @@ gc_mark_enqueue_span(PyObject **item, Py_ssize_t size, gc_mark_args_t *args)
590590
Py_ssize_t free = BUFFER_SIZE - used;
591591
if (free > size) {
592592
for (Py_ssize_t i = 0; i < size; i++) {
593-
gc_mark_buffer_push(item[i], args);
593+
PyObject *op = item[i];
594+
if (op == NULL) {
595+
continue;
596+
}
597+
gc_mark_buffer_push(op, args);
594598
}
595599
}
596600
else {

0 commit comments

Comments
 (0)