Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.

This commit is contained in:
Serhiy Storchaka 2015-12-03 01:05:52 +02:00
commit 7c088a9b5c
3 changed files with 24 additions and 0 deletions

View file

@ -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);