mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986)
This commit is contained in:
parent
e03073ff20
commit
05fc4d758a
3 changed files with 7 additions and 9 deletions
|
@ -551,7 +551,7 @@ _PyST_GetScope(PySTEntryObject *ste, PyObject *name)
|
|||
if (symbol < 0) {
|
||||
return -1;
|
||||
}
|
||||
return (symbol >> SCOPE_OFFSET) & SCOPE_MASK;
|
||||
return SYMBOL_TO_SCOPE(symbol);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -809,7 +809,7 @@ inline_comprehension(PySTEntryObject *ste, PySTEntryObject *comp,
|
|||
assert(_PyUnicode_EqualToASCIIString(k, ".0"));
|
||||
continue;
|
||||
}
|
||||
int scope = (comp_flags >> SCOPE_OFFSET) & SCOPE_MASK;
|
||||
int scope = SYMBOL_TO_SCOPE(comp_flags);
|
||||
int only_flags = comp_flags & ((1 << SCOPE_OFFSET) - 1);
|
||||
if (scope == CELL || only_flags & DEF_COMP_CELL) {
|
||||
if (PySet_Add(inlined_cells, k) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue