GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)

This commit is contained in:
Mark Shannon 2024-08-13 10:25:44 +01:00 committed by GitHub
parent 0e207f3e7a
commit fe23f8ed97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 122 additions and 87 deletions

View file

@ -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);