python/dist/src/Python compile.c, 2.291.6.1, 2.291.6.2
![](https://secure.gravatar.com/avatar/183afb31d4891087da6e177634ef10f8.jpg?s=120&d=mm&r=g)
Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv24911/Python Modified Files: Tag: release23-maint compile.c Log Message: Backport fix for SF808594: leak on lambda with duplicate arguments. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.291.6.1 retrieving revision 2.291.6.2 diff -C2 -d -r2.291.6.1 -r2.291.6.2 *** compile.c 16 Sep 2003 04:36:33 -0000 2.291.6.1 --- compile.c 22 Sep 2003 04:41:21 -0000 2.291.6.2 *************** *** 4771,4774 **** --- 4771,4784 ---- static int + symtable_error(struct symtable *st, int lineno) + { + if (lineno == 0) + lineno = st->st_cur->ste_lineno; + PyErr_SyntaxLocation(st->st_filename, lineno); + st->st_errors++; + return -1; + } + + static int symtable_load_symbols(struct compiling *c) { *************** *** 4828,4834 **** PyErr_Format(PyExc_SyntaxError, LOCAL_GLOBAL, PyString_AS_STRING(name)); ! PyErr_SyntaxLocation(st->st_filename, ! ste->ste_lineno); ! st->st_errors++; goto fail; } --- 4838,4842 ---- PyErr_Format(PyExc_SyntaxError, LOCAL_GLOBAL, PyString_AS_STRING(name)); ! symtable_error(st, 0); goto fail; } *************** *** 5183,5189 **** PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, PyString_AsString(name)); ! PyErr_SyntaxLocation(st->st_filename, ! st->st_cur->ste_lineno); ! return -1; } val |= flag; --- 5191,5195 ---- PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, PyString_AsString(name)); ! return symtable_error(st, 0); } val |= flag; *************** *** 5582,5588 **** "name '%.400s' is local and global", name); ! PyErr_SyntaxLocation(st->st_filename, ! st->st_cur->ste_lineno); ! st->st_errors++; return; } --- 5588,5592 ---- "name '%.400s' is local and global", name); ! symtable_error(st, 0); return; } *************** *** 5644,5650 **** PyErr_SetString(PyExc_SyntaxError, LATE_FUTURE); ! PyErr_SyntaxLocation(st->st_filename, ! n->n_lineno); ! st->st_errors++; return; } --- 5648,5652 ---- PyErr_SetString(PyExc_SyntaxError, LATE_FUTURE); ! symtable_error(st, n->n_lineno); return; } *************** *** 5740,5746 **** PyErr_SetString(PyExc_SyntaxError, ASSIGN_DEBUG); ! PyErr_SyntaxLocation(st->st_filename, ! n->n_lineno); ! st->st_errors++; } symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag); --- 5742,5747 ---- PyErr_SetString(PyExc_SyntaxError, ASSIGN_DEBUG); ! symtable_error(st, n->n_lineno); ! return; } symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag);
participants (1)
-
jhylton@users.sourceforge.net