File tree 1 file changed +3
-1
lines changed
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)
424
424
if (type -> tp_version_tag == 0 ) {
425
425
// Wrap-around or just starting Python - clear the whole cache
426
426
type_cache_clear (cache , 1 );
427
- return 1 ;
427
+ return 0 ;
428
428
}
429
429
430
430
bases = type -> tp_bases ;
@@ -3361,6 +3361,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
3361
3361
#if MCACHE_STATS
3362
3362
cache -> hits ++ ;
3363
3363
#endif
3364
+ assert (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ));
3364
3365
return entry -> value ;
3365
3366
}
3366
3367
@@ -3398,6 +3399,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
3398
3399
cache -> misses ++ ;
3399
3400
}
3400
3401
#endif
3402
+ assert (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ));
3401
3403
Py_SETREF (entry -> name , Py_NewRef (name ));
3402
3404
}
3403
3405
return res ;
You can’t perform that action at this time.
0 commit comments