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 | 31b9410654d73c9d1121ae9eb0d1bb14e6d54448 (patch) | |
| tree | d14fbbfd68e06bc2a0976e7bc4b11c459500a0d3 /Objects/unicodeobject.c | |
| parent | fab75d9bb90470f00ca02acc08f583de6c09f983 (diff) | |
| download | cpython-git-31b9410654d73c9d1121ae9eb0d1bb14e6d54448.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 2bc34c5730..cf4f8421eb 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); |
