mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
When running python -O, do not include blocks defined in asserts in
the symbol table pass. These blocks were already ignored by the code gen pass. Both passes must visit the same set of blocks in the same order. Fixes SF buf 132820
This commit is contained in:
parent
4779399e9f
commit
384639f80e
1 changed files with 11 additions and 0 deletions
|
@ -4496,6 +4496,17 @@ symtable_node(struct symtable *st, node *n)
|
|||
break;
|
||||
|
||||
}
|
||||
case assert_stmt:
|
||||
if (Py_OptimizeFlag)
|
||||
return;
|
||||
if (NCH(n) == 2) {
|
||||
n = CHILD(n, 1);
|
||||
goto loop;
|
||||
} else {
|
||||
symtable_node(st, CHILD(n, 1));
|
||||
n = CHILD(n, 3);
|
||||
goto loop;
|
||||
}
|
||||
case except_clause:
|
||||
if (NCH(n) == 4)
|
||||
symtable_assign(st, CHILD(n, 3), 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue