8000 bpo-43693: Do not check co_cell2arg if a non-cell offset. by ericsnowcurrently · Pull Request #26626 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43693: Do not check co_cell2arg if a non-cell offset. #26626

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
< F3D1 div class="ml-2 hide-sm hide-md">
Diff view
Do not check co_cell2arg if a non-cell offset.
  • Loading branch information
ericsnowcurrently committed Jun 9, 2021
commit 75ee4953beed04f1486a0418e0dee4e18a56bc4c
7 changes: 5 additions & 2 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,9 @@ PyFrame_FastToLocalsWithError(PyFrameObject *f)
PyObject *value = fast[i];
if (f->f_state != FRAME_CLEARED) {
int cellargoffset = CO_CELL_NOT_AN_ARG;
if (co->co_cell2arg != NULL) {
if (kind & CO_FAST_CELL && co->co_cell2arg != NULL) {
assert(i - co->co_nlocals >= 0);
assert(i - co->co_nlocals < co->co_ncellvars);
cellargoffset = co->co_cell2arg[i - co->co_nlocals];
}
if (kind & CO_FAST_FREE) {
Expand Down Expand Up @@ -1093,7 +1095,8 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
PyObject *oldvalue = fast[i];
int cellargoffset = CO_CELL_NOT_AN_ARG;
if (kind & CO_FAST_CELL && co->co_cell2arg != NULL) {
assert(i >= co->co_nlocals);
assert(i - co->co_nlocals >= 0);
assert(i - co->co_nlocals < co->co_ncellvars);
cellargoffset = co->co_cell2arg[i - co->co_nlocals];
}
PyObject *cell = NULL;
Expand Down
0