-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
GH-100719: Remove the co_nplaincellvars
field from code objects.
#100721
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Removed the co_nplaincellvars field from the code object, as it is | ||
redundant. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9514,7 +9514,7 @@ super_init_without_args(_PyInterpreterFrame *cframe, PyCodeObject *co, | |
|
||
// Look for __class__ in the free vars. | ||
PyTypeObject *type = NULL; | ||
int i = co->co_nlocals + co->co_nplaincellvars; | ||
int i = PyCode_GetFirstFree(co); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Py_ssize_t? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an int. I'll change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markshannon why should it be |
||
for (; i < co->co_nlocalsplus; i++) { | ||
assert((_PyLocals_GetKind(co->co_localspluskinds, i) & CO_FAST_FREE) != 0); | ||
PyObject *name = PyTuple_GET_ITEM(co->co_localsplusnames, i); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2260,7 +2260,7 @@ compiler_make_closure(struct compiler *c, location loc, | |
qualname = co->co_name; | ||
|
||
if (co->co_nfreevars) { | ||
int i = co->co_nlocals + co->co_nplaincellvars; | ||
int i = PyCode_GetFirstFree(co); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Py_ssize_t? |
||
for (; i < co->co_nlocalsplus; ++i) { | ||
/* Bypass com_addop_varname because it will generate | ||
LOAD_DEREF but LOAD_CLOSURE is needed. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Py_ssize_t?