File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ assign_version_tag(struct type_cache *cache, PyTypeObject *type)
424424 if (type -> tp_version_tag == 0 ) {
425425 // Wrap-around or just starting Python - clear the whole cache
426426 type_cache_clear (cache , 1 );
427- return 1 ;
427+ return 0 ;
428428 }
429429
430430 bases = type -> tp_bases ;
@@ -3361,6 +3361,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
33613361#if MCACHE_STATS
33623362 cache -> hits ++ ;
33633363#endif
3364+ assert (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ));
33643365 return entry -> value ;
33653366 }
33663367
@@ -3398,6 +3399,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
33983399 cache -> misses ++ ;
33993400 }
34003401#endif
3402+ assert (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ));
34013403 Py_SETREF (entry -> name , Py_NewRef (name ));
34023404 }
34033405 return res ;
You can’t perform that action at this time.
0 commit comments