Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! bpo-33930: Fix segfault with deep recursion when cleaning meth…
…od objects
  • Loading branch information
pablogsal committed Aug 9, 2021
commit 6bcd0a02e6acbdf535dcb1e02bfceb09caa64f4d
1 change: 1 addition & 0 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ def foo():
o = o.__dir__

foo()
Comment thread
pablogsal marked this conversation as resolved.
support.gc_collect()

@cpython_only
def test_recursion_normalizing_exception(self):
Expand Down
4 changes: 2 additions & 2 deletions Objects/methodobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void
meth_dealloc(PyCFunctionObject *m)
{
PyObject_GC_UnTrack(m);
Comment thread
ambv marked this conversation as resolved.
Py_TRASHCAN_SAFE_BEGIN(m);
Py_TRASHCAN_BEGIN(m, meth_dealloc);
if (m->m_weakreflist != NULL) {
PyObject_ClearWeakRefs((PyObject*) m);
}
Expand All @@ -171,7 +171,7 @@ meth_dealloc(PyCFunctionObject *m)
Py_XDECREF(m->m_self);
Py_XDECREF(m->m_module);
PyObject_GC_Del(m);
Py_TRASHCAN_SAFE_END(m);
Py_TRASHCAN_END;
}

static PyObject *
Expand Down