diff options
author | Guido van Rossum <guido@python.org> | 2000-03-13 16:01:29 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-03-13 16:01:29 +0000 |
commit | d724b23420f8e9d73a656c941c45b234e08ff9d6 (patch) | |
tree | a87fcb839783274d3d0fee3c9609793189a83d8e /Objects/listobject.c | |
parent | 96a45adf808ee9798d0c2637aeed2c895fa8e929 (diff) | |
download | cpython-git-d724b23420f8e9d73a656c941c45b234e08ff9d6.tar.gz |
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.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index d77b546edb..673028f31b 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -215,6 +215,7 @@ list_dealloc(op) PyListObject *op; { int i; + Py_TRASHCAN_SAFE_BEGIN(op) if (op->ob_item != NULL) { /* Do it backwards, for Christian Tismer. There's a simple test case where somehow this reduces @@ -227,6 +228,7 @@ list_dealloc(op) free((ANY *)op->ob_item); } free((ANY *)op); + Py_TRASHCAN_SAFE_END(op) } static int |