[Python-checkins] CVS: python/dist/src/Python compile.c,2.232,2.233 symtable.c,2.7,2.8
Jeremy Hylton
jhylton@users.sourceforge.net
Mon, 03 Dec 2001 18:41:48 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv22327
Modified Files:
compile.c symtable.c
Log Message:
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.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.232
retrieving revision 2.233
diff -C2 -d -r2.232 -r2.233
*** compile.c 2001/11/28 21:10:39 2.232
--- compile.c 2001/12/04 02:41:46 2.233
***************
*** 5465,5469 ****
ASSIGN_DEBUG);
PyErr_SyntaxLocation(st->st_filename,
! st->st_cur->ste_opt_lineno);
st->st_errors++;
}
--- 5465,5469 ----
ASSIGN_DEBUG);
PyErr_SyntaxLocation(st->st_filename,
! n->n_lineno);
st->st_errors++;
}
Index: symtable.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v
retrieving revision 2.7
retrieving revision 2.8
diff -C2 -d -r2.7 -r2.8
*** symtable.c 2001/11/28 21:36:28 2.7
--- symtable.c 2001/12/04 02:41:46 2.8
***************
*** 46,49 ****
--- 46,50 ----
ste->ste_optimized = 0;
+ ste->ste_opt_lineno = 0;
ste->ste_lineno = lineno;
switch (type) {