summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2010-08-19 21:35:59 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2010-08-19 21:35:59 (GMT)
commita1e5c69d5bc50b57ac10a27c77a6016947919abd (patch)
tree83518d23fee5d459fa2fcfd8d75a5061355bd605 /Python/ast.c
parentfc34ac5fdd8633179c1438ee9ef32a018d76e658 (diff)
downloadcpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.zip
cpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.tar.gz
cpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.tar.bz2
Merged revisions 84214 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84214 | amaury.forgeotdarc | 2010-08-19 23:32:38 +0200 (jeu., 19 août 2010) | 3 lines Add tests for r84209 (crashes in the Ast builder) Also remove one tab, and move a check closer to the possible failure. ........
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 2f974c0..5c17133 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -674,7 +674,7 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
expression = ast_for_expr(c, CHILD(n, i + 2));
if (!expression)
- goto error;
+ goto error;
asdl_seq_SET(kwdefaults, j, expression);
i += 2; /* '=' and test */
}
@@ -873,14 +873,14 @@ ast_for_arguments(struct compiling *c, const node *n)
ch = CHILD(n, i+1); /* tfpdef */
assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef);
kwarg = NEW_IDENTIFIER(CHILD(ch, 0));
+ if (!kwarg)
+ return NULL;
if (NCH(ch) > 1) {
/* there is an annotation on the kwarg */
kwargannotation = ast_for_expr(c, CHILD(ch, 2));
if (!kwargannotation)
return NULL;
}
- if (!kwarg)
- return NULL;
i += 3;
break;
default: