From: Victor Stinner Date: Sun, 23 Oct 2011 18:07:00 +0000 (+0200) Subject: Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p X-Git-Tag: v3.3.0a1~1032 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af9e4b8c29f152166a7dce34b8633d45e719442b;p=thirdparty%2FPython%2Fcpython.git Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 58f657e1e1a9..aedcec53c7ba 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); } }