Skip to content

Commit

Permalink
Add assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Mar 5, 2024
1 parent d5d39ec commit 2dc7762
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ list_get_item_ref(PyListObject *op, Py_ssize_t i)
return NULL;
}
Py_ssize_t cap = _Py_atomic_load_ssize_relaxed(&op->allocated);
assert(cap != -1 && cap >= size);
if (!valid_index(i, cap)) {
return NULL;
}
Expand Down

0 comments on commit 2dc7762

Please sign in to comment.