[issue43916] Check that new heap types cannot be created uninitialised

Serhiy Storchaka report at bugs.python.org
Mon Apr 26 08:10:44 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The explaining comment was added in f884b749103bad0724e2e4878cd5fe49a41bd7df.

The code itself is much older. It was originally added in 6d6c1a35e08b95a83dbe47dbd9e6474daff00354, then
weaked in c11e192d416e2970e6a06cf06d4cf788f322c6ea and strengthen in 29687cd2112c540a8a4d31cf3b191cf10db08412.

All types except static types which are direct descendants of object inherit tp_new from a base class.

We need to check which static types had tp_new = NULL before they were converted to heap types and set it to NULL manually after type creation.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43916>
_______________________________________


More information about the Python-bugs-list mailing list