Bug in unicode object free list?

Pasquale d'Aloise pasquale.daloise at gatelab.com
Sat Feb 11 17:40:46 CET 2006


I suspect there is a bug in the way the unicode object
"free list" is managed.

In the file unicodeobject.c, I noticed the following
statements whose behaviour is a bit ambiguous for me:

unicode_freelist = *(PyUnicodeObject **)unicode;
.....
*(PyUnicodeObject **)unicode = unicode_freelist;
......
u = *(PyUnicodeObject **)u;

It seems to me that those statements assume
the first member of  PyUnicodeObject is
"_ob_next" but this is true only if Py_TRACE_REFS
is defined.
If PyTRACE_REFS is not defined, the first member
of PyUnicodeObject is "ob_refcnt" and I think the above
statements have an unexpected behaviour.

Regards.

Pasquale d'Aloise
GATE T.I. s.r.l.
Viale dei Pentri, P.zzo D'Abbraccio
86170 ISERNIA
Tel. 0865.451890





More information about the Python-bugs-list mailing list