diff options
| author | Marta Gómez Macías <mgmacias@google.com> | 2023-03-05 11:00:41 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-05 11:00:41 (GMT) |
| commit | 66aa78cbe604a7c5731f074b869f92174a8e3b64 (patch) | |
| tree | 497aee1993fce7be009427638f48da111a9ecdc4 /Python/bltinmodule.c | |
| parent | 5da379ca7dff44b321450800252be01041b3320b (diff) | |
| download | cpython-66aa78cbe604a7c5731f074b869f92174a8e3b64.zip cpython-66aa78cbe604a7c5731f074b869f92174a8e3b64.tar.gz cpython-66aa78cbe604a7c5731f074b869f92174a8e3b64.tar.bz2 | |
gh-102356: Add thrashcan macros to filter object dealloc (#102426)
Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters.
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 53439ab..12ca0ba 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -553,9 +553,11 @@ static void filter_dealloc(filterobject *lz) { PyObject_GC_UnTrack(lz); + Py_TRASHCAN_BEGIN(lz, filter_dealloc) Py_XDECREF(lz->func); Py_XDECREF(lz->it); Py_TYPE(lz)->tp_free(lz); + Py_TRASHCAN_END } static int |
