Skip to content

Commit 5107da7

Browse files
Do not check co_cell2arg if a free var.
1 parent 969212a commit 5107da7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/frameobject.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
10921092
}
10931093
PyObject *oldvalue = fast[i];
10941094
int cellargoffset = CO_CELL_NOT_AN_ARG;
1095-
if (co->co_cell2arg != NULL) {
1095+
if (kind & CO_FAST_CELL && co->co_cell2arg != NULL) {
1096+
assert(i >= co->co_nlocals);
10961097
cellargoffset = co->co_cell2arg[i - co->co_nlocals];
10971098
}
10981099
PyObject *cell = NULL;

0 commit comments

Comments
 (0)