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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user