mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-101696: invalidate type version tag in _PyStaticType_Dealloc
(#101697)
This commit is contained in:
parent
2a8bf25804
commit
d9de079248
2 changed files with 3 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
Invalidate type version tag in ``_PyStaticType_Dealloc`` for static types, avoiding bug where a false cache hit could crash the interpreter. Patch by Kumar Aditya.
|
|
@ -4469,6 +4469,8 @@ _PyStaticType_Dealloc(PyTypeObject *type)
|
|||
}
|
||||
|
||||
type->tp_flags &= ~Py_TPFLAGS_READY;
|
||||
type->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
|
||||
type->tp_version_tag = 0;
|
||||
|
||||
if (type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) {
|
||||
_PyStaticType_ClearWeakRefs(type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue