mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.
This commit is contained in:
commit
7c088a9b5c
3 changed files with 24 additions and 0 deletions
|
@ -885,6 +885,11 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
|
|||
}
|
||||
new_size = (struct_size + (length + 1) * char_size);
|
||||
|
||||
if (_PyUnicode_HAS_UTF8_MEMORY(unicode)) {
|
||||
PyObject_DEL(_PyUnicode_UTF8(unicode));
|
||||
_PyUnicode_UTF8(unicode) = NULL;
|
||||
_PyUnicode_UTF8_LENGTH(unicode) = 0;
|
||||
}
|
||||
_Py_DEC_REFTOTAL;
|
||||
_Py_ForgetReference(unicode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue