mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)
This commit is contained in:
parent
0e207f3e7a
commit
fe23f8ed97
6 changed files with 122 additions and 87 deletions
|
@ -3051,7 +3051,6 @@ static int
|
|||
compiler_while(struct compiler *c, stmt_ty s)
|
||||
{
|
||||
NEW_JUMP_TARGET_LABEL(c, loop);
|
||||
NEW_JUMP_TARGET_LABEL(c, body);
|
||||
NEW_JUMP_TARGET_LABEL(c, end);
|
||||
NEW_JUMP_TARGET_LABEL(c, anchor);
|
||||
|
||||
|
@ -3060,9 +3059,8 @@ compiler_while(struct compiler *c, stmt_ty s)
|
|||
RETURN_IF_ERROR(compiler_push_fblock(c, LOC(s), WHILE_LOOP, loop, end, NULL));
|
||||
RETURN_IF_ERROR(compiler_jump_if(c, LOC(s), s->v.While.test, anchor, 0));
|
||||
|
||||
USE_LABEL(c, body);
|
||||
VISIT_SEQ(c, stmt, s->v.While.body);
|
||||
RETURN_IF_ERROR(compiler_jump_if(c, LOC(s), s->v.While.test, body, 1));
|
||||
ADDOP_JUMP(c, NO_LOCATION, JUMP, loop);
|
||||
|
||||
compiler_pop_fblock(c, WHILE_LOOP, loop);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue