diff Python/compile.c @ 16680:17ed61fd5b65 legacy-trunk

When running python -O, do not include blocks defined in asserts in the symbol table pass. These blocks were already ignored by the code gen pass. Both passes must visit the same set of blocks in the same order. Fixes SF buf 132820
author Jeremy Hylton <jeremy@alum.mit.edu>
date Mon, 19 Feb 2001 15:50:51 +0000
parents b955e74955d5
children 7334b2cedda8
line wrap: on
line diff
--- a/Python/compile.c	Mon Feb 19 15:35:26 2001 +0000
+++ b/Python/compile.c	Mon Feb 19 15:50:51 2001 +0000
@@ -4496,6 +4496,17 @@
 		break;
 
 	}
+	case assert_stmt: 
+		if (Py_OptimizeFlag)
+			return;
+		if (NCH(n) == 2) {
+			n = CHILD(n, 1);
+			goto loop;
+		} else {
+			symtable_node(st, CHILD(n, 1));
+			n = CHILD(n, 3);
+			goto loop;
+		}
 	case except_clause:
 		if (NCH(n) == 4)
 			symtable_assign(st, CHILD(n, 3), 0);