bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (GH-29103)

This commit is contained in:
Petr Viktorin 2021-10-21 11:46:20 +02:00 committed by GitHub
parent 2cbf50e812
commit 8a310dd5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 166 additions and 20 deletions

View file

@ -290,6 +290,7 @@ typedef struct _heaptypeobject {
PyObject *ht_name, *ht_slots, *ht_qualname;
struct _dictkeysobject *ht_cached_keys;
PyObject *ht_module;
char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec
/* here are optional user slots, followed by the members. */
} PyHeapTypeObject;