mirror of
https://github.com/python/cpython
synced 2026-09-29 09:25:29 +03:00
long_to_decimal_string() and _PyLong_Format() check the consistency of newly
created strings using _PyUnicode_CheckConsistency() in debug mode
This commit is contained in:
parent
aed97733df
commit
3065093bb3
1 changed files with 2 additions and 0 deletions
|
|
@ -1657,6 +1657,7 @@ long_to_decimal_string(PyObject *aa)
|
|||
|
||||
/* check we've counted correctly */
|
||||
assert(p == PyUnicode_1BYTE_DATA(str));
|
||||
assert(_PyUnicode_CheckConsistency(str, 1));
|
||||
Py_DECREF(scratch);
|
||||
return (PyObject *)str;
|
||||
}
|
||||
|
|
@ -1761,6 +1762,7 @@ _PyLong_Format(PyObject *aa, int base)
|
|||
if (negative)
|
||||
*--p = '-';
|
||||
assert(p == PyUnicode_1BYTE_DATA(v));
|
||||
assert(_PyUnicode_CheckConsistency(v, 1));
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue