GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880)

This commit is contained in:
Sergey Miryanov 2026-03-13 03:16:53 +05:00 committed by GitHub
parent cd52172831
commit f105265538
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11737,7 +11737,7 @@ update_one_slot(PyTypeObject *type, pytype_slotdef *p, pytype_slotdef **next_p,
if (Py_IS_TYPE(descr, &PyWrapperDescr_Type) &&
((PyWrapperDescrObject *)descr)->d_base->name_strobj == p->name_strobj) {
void **tptr;
size_t index = (p - slotdefs) / sizeof(slotdefs[0]);
size_t index = (p - slotdefs);
if (slotdefs_name_counts[index] == 1) {
tptr = slotptr(type, p->offset);
}