diff Python/ast.c @ 47727:6f6fed4f0626 2.5

#3117: backport r55087, fixes segfault with lambda (None,): None.
author Georg Brandl <georg@python.org>
date Sun, 15 Jun 2008 19:53:12 +0000
parents 7d2e1ac834b8
children ca0d620cd63b
line wrap: on
line diff
--- a/Python/ast.c	Tue Jun 03 10:26:21 2008 +0000
+++ b/Python/ast.c	Sun Jun 15 19:53:12 2008 +0000
@@ -249,6 +249,8 @@
 		    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 @@
 		    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