GH-100719: Remove the co_nplaincellvars field from code objects. (GH-100721)

This commit is contained in:
Mark Shannon 2023-01-04 15:41:39 +00:00 committed by GitHub
parent c31e356a10
commit 15aecf8dd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 23 deletions

View file

@ -1575,8 +1575,8 @@
PyCodeObject *co = frame->f_code;
assert(PyFunction_Check(frame->f_funcobj));
PyObject *closure = ((PyFunctionObject *)frame->f_funcobj)->func_closure;
int offset = co->co_nlocals + co->co_nplaincellvars;
assert(oparg == co->co_nfreevars);
int offset = co->co_nlocalsplus - oparg;
for (int i = 0; i < oparg; ++i) {
PyObject *o = PyTuple_GET_ITEM(closure, i);
frame->localsplus[offset + i] = Py_NewRef(o);