Skip to content

Commit 5a4d984

Browse files
Use the right offset in super_init_without_args().
1 parent 9cdc8ba commit 5a4d984

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/typeobject.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -8884,9 +8884,10 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
88848884
/* The first argument might be a cell. */
88858885
for (i = 0; i < co->co_ncellvars; i++) {
88868886
if (co->co_cell2arg[i] == 0) {
8887-
PyObject *cell = f->f_localsptr[co->co_nlocals + i];
8887+
int celloffset = co->co_nlocals + i;
8888+
PyObject *cell = f->f_localsptr[celloffset];
88888889
if (PyCell_Check(cell) &&
8889-
_PyFrame_OpAlreadyRan(f, MAKE_CELL, 0)) {
8890+
_PyFrame_OpAlreadyRan(f, MAKE_CELL, celloffset)) {
88908891
obj = PyCell_GET(cell);
88918892
}
88928893
break;

0 commit comments

Comments
 (0)