From 3cda0ed062892c46cbae43989ff59399e8042f58 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 13 Dec 2014 16:06:19 -0500 Subject: pop the loop block even for infinite while loops (closes #23048) --- Python/compile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index ec7a4acd88f..b07c15647e4 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2029,10 +2029,9 @@ compiler_while(struct compiler *c, stmt_ty s) if there is no else clause ? */ - if (constant == -1) { + if (constant == -1) compiler_use_next_block(c, anchor); - ADDOP(c, POP_BLOCK); - } + ADDOP(c, POP_BLOCK); compiler_pop_fblock(c, LOOP, loop); if (orelse != NULL) /* what if orelse is just pass? */ VISIT_SEQ(c, stmt, s->v.While.orelse); -- cgit v1.2.3