[issue16447] SEGFAULT when setting type.__name__

Amaury Forgeot d'Arc report at bugs.python.org
Fri Nov 9 13:29:53 CET 2012


Amaury Forgeot d'Arc added the comment:

- For the replacement with NULL, Py_CLEAR() should be used instead.

- We should use a macro (Py_REF_ASSIGN?) for the replacement case.

- Careful, in Modules/_json.c the code is wrong because tmp is already used::

        PyObject *tmp = PyUnicode_AsEncodedString(...);
        {
            PyObject *tmp = s->encoding;
            s->encoding = tmp;
            Py_DECREF(tmp);
        }

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16447>
_______________________________________


More information about the Python-bugs-list mailing list