]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880)
authorSergey Miryanov <sergey.miryanov@gmail.com>
Thu, 12 Mar 2026 22:16:53 +0000 (03:16 +0500)
committerGitHub <noreply@github.com>
Thu, 12 Mar 2026 22:16:53 +0000 (23:16 +0100)
Objects/typeobject.c

index 2a818f5f0205fd1c06356cd3cfad7eda4fa278b3..7b4318e79fb2befa7280a5e2e2fc5cf2e9d0ca85 100644 (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);
             }