mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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:
parent
96a45adf80
commit
d724b23420
7 changed files with 104 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue