diff options
author | Georg Brandl <georg@python.org> | 2008-06-15 19:53:12 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-15 19:53:12 +0000 |
commit | 9aa9fec0d5bc1450a77e7c35e62bd132c610766d (patch) | |
tree | 2638d8756df3731d0967dc1c3d2bee76f0e82ca8 /Python | |
parent | 94e34a17acb9dffdba8b69b17b4ba77a9e6aede9 (diff) | |
download | cpython-9aa9fec0d5bc1450a77e7c35e62bd132c610766d.tar.gz |
#3117: backport r55087, fixes segfault with lambda (None,): None.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index c7fd8bcc96..057b64df32 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -249,6 +249,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 { @@ -679,6 +681,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 |