From af9e4b8c29f152166a7dce34b8633d45e719442b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 23 Oct 2011 20:07:00 +0200 Subject: [PATCH] Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p --- Objects/unicodeobject.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 58f657e1e1..aedcec53c7 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); } } -- 2.40.0