diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-12-13 16:06:19 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-12-13 16:06:19 -0500 |
commit | 7f9644fe46166f4cbf29e1f7f753c910a8ec958b (patch) | |
tree | 651cac869ec0f78176f4869935739483d0121505 /Python/compile.c | |
parent | 33b434c53db50fd9d45b073ea2881e2538726b02 (diff) | |
download | cpython-7f9644fe46166f4cbf29e1f7f753c910a8ec958b.tar.gz |
pop the loop block even for infinite while loops (closes #23048)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c index ec7a4acd88..b07c15647e 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); |