Commit 518f6e9c authored by Thomas Wouters's avatar Thomas Wouters

The list comp patch checked for the second child node of the 'listmaker'

node, without checking if the node actually had more than one child. It can
have only one node, though: '[' test ']'. This fixes it.
parent 655b8445
...@@ -1045,7 +1045,7 @@ static void ...@@ -1045,7 +1045,7 @@ static void
com_listmaker(struct compiling *c, node *n) com_listmaker(struct compiling *c, node *n)
{ {
/* listmaker: test ( list_iter | (',' test)* [','] ) */ /* listmaker: test ( list_iter | (',' test)* [','] ) */
if (TYPE(CHILD(n, 1)) == list_iter) if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_iter)
com_list_comprehension(c, n); com_list_comprehension(c, n);
else { else {
int len = 0; int len = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment