Skip to content

Commit 41b3f0a

Browse files
authored
gh-156466: fix cleanup on error after Enter in codegen_enter_scope (#156467)
1 parent c8ca336 commit 41b3f0a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Python/codegen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,13 @@ codegen_enter_scope(compiler *c, identifier name, int scope_type,
700700
* of 0. This is because RETURN_GENERATOR pushes the generator
701701
before returning. */
702702
location loc = LOCATION(lineno, lineno, -1, -1);
703-
ADDOP(c, loc, RETURN_GENERATOR);
704-
ADDOP(c, loc, POP_TOP);
703+
ADDOP_IN_SCOPE(c, loc, RETURN_GENERATOR);
704+
ADDOP_IN_SCOPE(c, loc, POP_TOP);
705705
}
706706

707-
ADDOP_I(c, loc, RESUME, RESUME_AT_FUNC_START);
707+
ADDOP_I_IN_SCOPE(c, loc, RESUME, RESUME_AT_FUNC_START);
708708
if (scope_type == COMPILE_SCOPE_MODULE) {
709-
ADDOP(c, loc, ANNOTATIONS_PLACEHOLDER);
709+
ADDOP_IN_SCOPE(c, loc, ANNOTATIONS_PLACEHOLDER);
710710
}
711711
return SUCCESS;
712712
}

0 commit comments

Comments
 (0)