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)
commit31b9410654d73c9d1121ae9eb0d1bb14e6d54448 (patch)
treed14fbbfd68e06bc2a0976e7bc4b11c459500a0d3 /Objects
parentfab75d9bb90470f00ca02acc08f583de6c09f983 (diff)
downloadcpython-31b9410654d73c9d1121ae9eb0d1bb14e6d54448.zip
cpython-31b9410654d73c9d1121ae9eb0d1bb14e6d54448.tar.gz
cpython-31b9410654d73c9d1121ae9eb0d1bb14e6d54448.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 2bc34c5..cf4f842 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -679,6 +679,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);