summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-19 15:50:51 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-19 15:50:51 +0000
commitf550caea6981ad4205d75aa7e4d0702e76b8a7c3 (patch)
tree62977bf7dadd1a50ee455183f3fa82cdca5dc931 /Python/compile.c
parenta1b878b491516969032d0c3d05b6faedb282c3bc (diff)
downloadcpython-f550caea6981ad4205d75aa7e4d0702e76b8a7c3.tar.gz
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
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 2f98067ac8..bc568c9e66 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4496,6 +4496,17 @@ symtable_node(struct symtable *st, node *n)
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);