https://github.com/python/cpython/commit/f105265538823126dda5bc113fdb72cb2d5d2dbc
commit: f105265538823126dda5bc113fdb72cb2d5d2dbc
branch: main
author: Sergey Miryanov <[email protected]>
committer: vstinner <[email protected]>
date: 2026-03-12T23:16:53+01:00
summary:

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

files:
M Objects/typeobject.c

diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 2a818f5f0205fd..7b4318e79fb2be 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);
             }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to