diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-03 01:02:03 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-03 01:02:03 +0200 |
commit | e800941d66c432d29926f142085e29eca4abf6f3 (patch) | |
tree | 0cdc7dd7facab556fd87105897fb90792f9e17f9 /Objects/unicodeobject.c | |
parent | a8f4405044f2ef834a389f50557e81221c42786c (diff) | |
download | cpython-git-e800941d66c432d29926f142085e29eca4abf6f3.tar.gz |
Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 8b885dfec2..0b78301f23 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -722,6 +722,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); |