summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-12-04 02:41:46 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-12-04 02:41:46 (GMT)
commit86424e333f1736591114da975c8d2926ba6f51f5 (patch)
tree6bc48e16d500640a0f448eac30521a3c24337159 /Python/symtable.c
parent22a51efc1cb9b3d5c945bf90fd8906306c367604 (diff)
downloadcpython-86424e333f1736591114da975c8d2926ba6f51f5.zip
cpython-86424e333f1736591114da975c8d2926ba6f51f5.tar.gz
cpython-86424e333f1736591114da975c8d2926ba6f51f5.tar.bz2
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.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 080bfd5..74d2b82 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -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: