Skip to content

Commit f105265

Browse files
GH-132042: Fix calculation of slotdef index in update_one_slot() (#145880)
1 parent cd52172 commit f105265

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11737,7 +11737,7 @@ update_one_slot(PyTypeObject *type, pytype_slotdef *p, pytype_slotdef **next_p,
1173711737
if (Py_IS_TYPE(descr, &PyWrapperDescr_Type) &&
1173811738
((PyWrapperDescrObject *)descr)->d_base->name_strobj == p->name_strobj) {
1173911739
void **tptr;
11740-
size_t index = (p - slotdefs) / sizeof(slotdefs[0]);
11740+
size_t index = (p - slotdefs);
1174111741
if (slotdefs_name_counts[index] == 1) {
1174211742
tptr = slotptr(type, p->offset);
1174311743
}

0 commit comments

Comments
 (0)