Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:

>Bugs in set_repr:
>> keys = PySequence_List((PyObject *)so);
>> if (keys == NULL)
>>      goto done;
>> 
>> listrepr = PyObject_Repr(keys);
>> Py_DECREF(keys);
>List pointed to by keys is already deallocated at this point.
>> if (listrepr == NULL) {
>>      Py_DECREF(keys);
>>But this code tries to DECREF it.
>>      goto done;
>> }

I don't follow why you think keys is already deallocated.
When assigned by PySequence_List() without a NULL return, the refcnt is one. 
The call to PyObject_Repr(keys) does not change the refcnt of keys,
so the Py_DECREF(keys) is correct.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8420>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to