mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
bpo-43693: Turn localspluskinds into an object (GH-26749)
Managing it as a bare pointer to malloc'ed bytes is just too awkward in a few places.
This commit is contained in:
parent
c5d700f0e2
commit
355f5dd36a
14 changed files with 5455 additions and 5395 deletions
|
@ -8864,7 +8864,7 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
|
|||
|
||||
PyObject *firstarg = f->f_localsptr[0];
|
||||
// The first argument might be a cell.
|
||||
if (firstarg != NULL && (co->co_localspluskinds[0] & CO_FAST_CELL)) {
|
||||
if (firstarg != NULL && (_PyLocals_GetKind(co->co_localspluskinds, 0) & CO_FAST_CELL)) {
|
||||
// "firstarg" is a cell here unless (very unlikely) super()
|
||||
// was called from the C-API before the first MAKE_CELL op.
|
||||
if (f->f_lasti >= 0) {
|
||||
|
@ -8883,7 +8883,7 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
|
|||
PyTypeObject *type = NULL;
|
||||
int i = co->co_nlocals + co->co_nplaincellvars;
|
||||
for (; i < co->co_nlocalsplus; i++) {
|
||||
assert((co->co_localspluskinds[i] & CO_FAST_FREE) != 0);
|
||||
assert((_PyLocals_GetKind(co->co_localspluskinds, i) & CO_FAST_FREE) != 0);
|
||||
PyObject *name = PyTuple_GET_ITEM(co->co_localsplusnames, i);
|
||||
assert(PyUnicode_Check(name));
|
||||
if (_PyUnicode_EqualToASCIIId(name, &PyId___class__)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue