diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-12-13 21:06:19 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-12-13 21:06:19 (GMT) |
commit | 7a6a97352d9a99e83e6beca729d14bb6ca542d12 (patch) | |
tree | a077be9ca0db76151f770049f3b680c9f2447901 /Python/compile.c | |
parent | 0bf02c8df48c6494a115185943d94ee5f791deb6 (diff) | |
download | cpython-7a6a97352d9a99e83e6beca729d14bb6ca542d12.zip cpython-7a6a97352d9a99e83e6beca729d14bb6ca542d12.tar.gz cpython-7a6a97352d9a99e83e6beca729d14bb6ca542d12.tar.bz2 |
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 9d9e629..1f59c8c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1716,10 +1716,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); |