summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-02 23:02:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-02 23:02:03 (GMT)
commit7aa690860eceb74332c1edad1b8a7c4956bbdad5 (patch)
tree4ca201c7171fa7be8d031c9ecf5db4ff741985ae /Objects
parentf02de4938ec51e1cb1f867f40c457b1b7c2c6dd9 (diff)
downloadcpython-7aa690860eceb74332c1edad1b8a7c4956bbdad5.zip
cpython-7aa690860eceb74332c1edad1b8a7c4956bbdad5.tar.gz
cpython-7aa690860eceb74332c1edad1b8a7c4956bbdad5.tar.bz2
Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 6fc3683..193d898 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -724,6 +724,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);