mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
_PyUnicodeWriter_PrepareInternal(): make the assertion more strict
This commit is contained in:
parent
ca9381ea01
commit
6174474bea
1 changed files with 2 additions and 1 deletions
|
@ -13307,7 +13307,8 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
|
|||
PyObject *newbuffer;
|
||||
|
||||
/* ensure that the _PyUnicodeWriter_Prepare macro was used */
|
||||
assert(maxchar > writer->maxchar || length > 0);
|
||||
assert((maxchar > writer->maxchar && length >= 0)
|
||||
|| length > 0);
|
||||
|
||||
if (length > PY_SSIZE_T_MAX - writer->pos) {
|
||||
PyErr_NoMemory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue