Mailing List Archive

CVS: python/dist/src/Python traceback.c,2.36,2.36.6.1
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv27430

Modified Files:
Tag: release22-maint
traceback.c
Log Message:
Backport to 2.2.1:

This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).

The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!


Index: traceback.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/traceback.c,v
retrieving revision 2.36
retrieving revision 2.36.6.1
diff -C2 -d -r2.36 -r2.36.6.1
*** traceback.c 28 Nov 2001 20:42:20 -0000 2.36
--- traceback.c 29 Mar 2002 14:47:18 -0000 2.36.6.1
***************
*** 36,41 ****
tb_dealloc(tracebackobject *tb)
{
Py_TRASHCAN_SAFE_BEGIN(tb)
- _PyObject_GC_UNTRACK(tb);
Py_XDECREF(tb->tb_next);
Py_XDECREF(tb->tb_frame);
--- 36,41 ----
tb_dealloc(tracebackobject *tb)
{
+ PyObject_GC_UnTrack(tb);
Py_TRASHCAN_SAFE_BEGIN(tb)
Py_XDECREF(tb->tb_next);
Py_XDECREF(tb->tb_frame);