summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-05-03 06:47:18 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-05-03 06:47:18 (GMT)
commitdc9b32e1ab6051c0f4c2f13010bd884baef2a8c2 (patch)
treeb77cef6167800082859e3fc876735ff1d51e964c
parentb8ae3d01389f1b079303516aca24f61005c89ee1 (diff)
downloadcpython-dc9b32e1ab6051c0f4c2f13010bd884baef2a8c2.zip
cpython-dc9b32e1ab6051c0f4c2f13010bd884baef2a8c2.tar.gz
cpython-dc9b32e1ab6051c0f4c2f13010bd884baef2a8c2.tar.bz2
Handle a couple of uncaught errors. This should be backported
-rw-r--r--Python/ast.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index be58f53..ace4950 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -244,6 +244,8 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
goto error;
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
arena));
+ if (!asdl_seq_GET(stmts, 0))
+ goto error;
return Interactive(stmts, arena);
}
else {
@@ -675,6 +677,8 @@ ast_for_arguments(struct compiling *c, const node *n)
if (NCH(ch) != 1) {
/* We have complex arguments, setup for unpacking. */
asdl_seq_SET(args, k++, compiler_complex_args(c, ch));
+ if (!asdl_seq_GET(args, k-1))
+ goto error;
} else {
/* def foo((x)): setup for checking NAME below. */
/* Loop because there can be many parens and tuple