mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
SF bug #488687 reported by Neal Norwitz
The error for assignment to __debug__ used ste->ste_opt_lineno instead of n->n_lineno. The latter was at best incorrect; often the slot was uninitialized. Two fixes here: Use the correct lineno for the error. Initialize ste_opt_lineno in PySymtable_New(); while there are no current cases where it is referenced unless it has already been assigned to, there is no harm in initializing it.
This commit is contained in:
parent
22a51efc1c
commit
86424e333f
2 changed files with 2 additions and 1 deletions
|
@ -45,6 +45,7 @@ PySymtableEntry_New(struct symtable *st, char *name, int type, int lineno)
|
|||
ste->ste_children = v;
|
||||
|
||||
ste->ste_optimized = 0;
|
||||
ste->ste_opt_lineno = 0;
|
||||
ste->ste_lineno = lineno;
|
||||
switch (type) {
|
||||
case funcdef:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue