From: Sergey Miryanov Date: Thu, 12 Mar 2026 22:16:53 +0000 (+0500) Subject: GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880) X-Git-Tag: v3.15.0a8~334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f105265538823126dda5bc113fdb72cb2d5d2dbc;p=thirdparty%2FPython%2Fcpython.git GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880) --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 2a818f5f0205..7b4318e79fb2 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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); }