Skip to content

Commit

Permalink
Use the right offset in super_init_without_args().
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Jun 7, 2021
1 parent 9cdc8ba commit 5a4d984
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -8884,9 +8884,10 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
/* The first argument might be a cell. */
for (i = 0; i < co->co_ncellvars; i++) {
if (co->co_cell2arg[i] == 0) {
PyObject *cell = f->f_localsptr[co->co_nlocals + i];
int celloffset = co->co_nlocals + i;
PyObject *cell = f->f_localsptr[celloffset];
if (PyCell_Check(cell) &&
_PyFrame_OpAlreadyRan(f, MAKE_CELL, 0)) {
_PyFrame_OpAlreadyRan(f, MAKE_CELL, celloffset)) {
obj = PyCell_GET(cell);
}
break;
Expand Down

0 comments on commit 5a4d984

Please sign in to comment.