[Python-checkins] python/dist/src/Python graminit.c,2.40,2.41

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Fri Oct 21 08:24:05 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8692/Python

Modified Files:
	graminit.c 
Log Message:
Fix SF bug #1167751, Argument genexp corner case

Incorrect code was generated for:

  foo(a = i for i in range(10))

This should have generated a SyntaxError.  Fix the Grammar so
it raises a SyntaxError and test it.

I'm uncertain whether this should be backported.  It makes
something that was Syntactically valid invalid.  However,
the code would either be completely broken or do the wrong thing.


Index: graminit.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/graminit.c,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -d -r2.40 -r2.41
--- graminit.c	2 Aug 2005 00:46:46 -0000	2.40
+++ graminit.c	21 Oct 2005 06:24:02 -0000	2.41
@@ -1496,26 +1496,34 @@
 	{26, 1},
 };
 static arc arcs_69_1[3] = {
-	{25, 2},
-	{147, 3},
+	{147, 2},
+	{25, 3},
 	{0, 1},
 };
 static arc arcs_69_2[1] = {
-	{26, 4},
+	{0, 2},
 };
 static arc arcs_69_3[1] = {
-	{0, 3},
+	{26, 4},
 };
 static arc arcs_69_4[2] = {
-	{147, 3},
+	{13, 5},
 	{0, 4},
 };
-static state states_69[5] = {
+static arc arcs_69_5[1] = {
+	{147, 6},
+};
+static arc arcs_69_6[1] = {
+	{15, 2},
+};
+static state states_69[7] = {
 	{1, arcs_69_0},
 	{3, arcs_69_1},
 	{1, arcs_69_2},
 	{1, arcs_69_3},
 	{2, arcs_69_4},
+	{1, arcs_69_5},
+	{1, arcs_69_6},
 };
 static arc arcs_70_0[2] = {
 	{146, 1},
@@ -1806,7 +1814,7 @@
 	 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000"},
 	{324, "arglist", 0, 8, states_68,
 	 "\000\040\010\060\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
-	{325, "argument", 0, 5, states_69,
+	{325, "argument", 0, 7, states_69,
 	 "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
 	{326, "list_iter", 0, 2, states_70,
 	 "\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"},



More information about the Python-checkins mailing list