Skip to content

Commit

Permalink
Update retroactive comments from pythonGH-117741 (segfault in `Future…
Browse files Browse the repository at this point in the history
…Iter_dealloc`) (pythonGH-121638)

Address comments
  • Loading branch information
savannahostrowski authored and estyxx committed Jul 17, 2024
1 parent e4a0f5c commit ff058c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Misc/NEWS.d/3.13.0b1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,6 @@ asend().throw()

..
.. date: 2024-04-13-18-59-25
.. gh-issue: 115874
.. nonce: c3xG-E
.. section: Core and Builtins
Fixed a possible segfault during garbage collection of
``_asyncio.FutureIter`` objects

..
.. date: 2024-04-13-16-55-53
.. gh-issue: 117536
.. nonce: xkVbfv
Expand Down Expand Up @@ -883,6 +873,16 @@ Alex Waygood.

..
.. date: 2024-04-13-18-59-25
.. gh-issue: 115874
.. nonce: c3xG-E
.. section: Library
Fixed a possible segfault during garbage collection of
``_asyncio.FutureIter`` objects. Patch by Savannah Ostrowski.

..
.. date: 2024-04-13-01-45-15
.. gh-issue: 115060
.. nonce: IxoM03
Expand Down
3 changes: 0 additions & 3 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,6 @@ FutureIter_dealloc(futureiterobject *it)
{
PyTypeObject *tp = Py_TYPE(it);

// FutureIter is a heap type so any subclass must also be a heap type.
assert(_PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE));

PyObject *module = ((PyHeapTypeObject*)tp)->ht_module;
Expand All @@ -1661,8 +1660,6 @@ FutureIter_dealloc(futureiterobject *it)

// GH-115874: We can't use PyType_GetModuleByDef here as the type might have
// already been cleared, which is also why we must check if ht_module != NULL.
// Due to this restriction, subclasses that belong to a different module
// will not be able to use the free list.
if (module && _PyModule_GetDef(module) == &_asynciomodule) {
state = get_asyncio_state(module);
}
Expand Down

0 comments on commit ff058c2

Please sign in to comment.