Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p

This commit is contained in:
Victor Stinner 2011-10-23 20:07:00 +02:00
parent 9faa384bed
commit af9e4b8c29
1 changed files with 1 additions and 3 deletions

View File

@ -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);
}
}