]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)
authorVictor Stinner <vstinner@python.org>
Fri, 21 May 2021 17:19:54 +0000 (19:19 +0200)
committerGitHub <noreply@github.com>
Fri, 21 May 2021 17:19:54 +0000 (19:19 +0200)
commit615069eb08494d089bf24e43547fbc482ed699b8
tree06d4a3c69bb0f8078f4021aee8c19d2924a2f774
parent642fdfdc04e8e40c2cd3e65d67b09fac472bb345
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)

Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.

Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.

_PyMem_IsPtrFreed() argument is now constant.
Include/internal/pycore_pymem.h
Lib/test/test_gc.py
Misc/NEWS.d/next/Core and Builtins/2021-05-21-01-42-45.bpo-44184.9qOptC.rst [new file with mode: 0644]
Objects/typeobject.c