[Python-checkins] cpython: Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p

victor.stinner python-checkins at python.org
Sat Oct 29 02:01:13 CEST 2011


http://hg.python.org/cpython/rev/d8c36928d35b
changeset:   73187:d8c36928d35b
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sun Oct 23 20:07:00 2011 +0200
summary:
  Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p

files:
  Objects/unicodeobject.c |  4 +---
  1 files changed, 1 insertions(+), 3 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -14001,11 +14001,9 @@
 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);
     }
 }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list