summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-13 21:06:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-12-13 21:06:19 (GMT)
commit3cda0ed062892c46cbae43989ff59399e8042f58 (patch)
tree05e8b96522ce3b7774394365b73df0cdf1275806 /Python
parentdb9b65d9e5d9d39199714cfd15a26e46ab0eaae1 (diff)
downloadcpython-3cda0ed062892c46cbae43989ff59399e8042f58.zip
cpython-3cda0ed062892c46cbae43989ff59399e8042f58.tar.gz
cpython-3cda0ed062892c46cbae43989ff59399e8042f58.tar.bz2
pop the loop block even for infinite while loops (closes #23048)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index ec7a4ac..b07c156 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);