diff options
author | Mark Shannon <mark@hotpy.org> | 2024-08-13 09:25:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-13 09:25:44 (GMT) |
commit | fe23f8ed970425828de20fb48750fa89da914886 (patch) | |
tree | 4bcd11c9d4f579a73345b0212d126e764c5ba662 /Python/compile.c | |
parent | 0e207f3e7adc6a0fdbe1482ce01163ff04d5ddcb (diff) | |
download | cpython-fe23f8ed970425828de20fb48750fa89da914886.zip cpython-fe23f8ed970425828de20fb48750fa89da914886.tar.gz cpython-fe23f8ed970425828de20fb48750fa89da914886.tar.bz2 |
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c index 9695a99..0efa747 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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); |