Commit 6174474b authored by Victor Stinner's avatar Victor Stinner

_PyUnicodeWriter_PrepareInternal(): make the assertion more strict

parent ca9381ea
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment