diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-23 18:07:00 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-23 18:07:00 (GMT) |
commit | af9e4b8c29f152166a7dce34b8633d45e719442b (patch) | |
tree | b4fde37c45279481be96ada1a10f6faae7483af1 /Objects/unicodeobject.c | |
parent | 9faa384bedd3ede3ece06ffe0e440a99f6e7e575 (diff) | |
download | cpython-af9e4b8c29f152166a7dce34b8633d45e719442b.zip cpython-af9e4b8c29f152166a7dce34b8633d45e719442b.tar.gz cpython-af9e4b8c29f152166a7dce34b8633d45e719442b.tar.bz2 |
Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 58f657e..aedcec5 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -14001,11 +14001,9 @@ PyUnicode_InternInPlace(PyObject **p) void PyUnicode_InternImmortal(PyObject **p) { - PyUnicodeObject *u = (PyUnicodeObject *)*p; - PyUnicode_InternInPlace(p); if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) { - _PyUnicode_STATE(u).interned = SSTATE_INTERNED_IMMORTAL; + _PyUnicode_STATE(*p).interned = SSTATE_INTERNED_IMMORTAL; Py_INCREF(*p); } } |