Christian Tismer's "trashcan" patch:

Added wrapping macros to dictobject.c, listobject.c, tupleobject.c,
frameobject.c, traceback.c that safely prevends core dumps
on stack overflow. Macros and functions in object.c, object.h.
The method is an "elevator destructor" that turns cascading
deletes into tail recursive behavior when some limit is hit.
This commit is contained in:
Guido van Rossum 2000-03-13 16:01:29 +00:00
parent 96a45adf80
commit d724b23420
7 changed files with 104 additions and 1 deletions

View file

@ -68,9 +68,11 @@ static void
tb_dealloc(tb)
tracebackobject *tb;
{
Py_TRASHCAN_SAFE_BEGIN(tb)
Py_XDECREF(tb->tb_next);
Py_XDECREF(tb->tb_frame);
PyMem_DEL(tb);
Py_TRASHCAN_SAFE_END(tb)
}
#define Tracebacktype PyTraceBack_Type