mirror of
https://github.com/python/cpython.git
synced 2024-11-25 02:44:06 +08:00
Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p
This commit is contained in:
parent
9faa384bed
commit
af9e4b8c29
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user