mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
pop the loop block even for infinite while loops (closes #23048)
This commit is contained in:
parent
db9b65d9e5
commit
3cda0ed062
4 changed files with 19 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue