Skip to content

Commit d0d8d4f

Browse files
committed
gh-156466: fix cleanup on error after Enter in codegen_enter_scope
1 parent 2a37d67 commit d0d8d4f

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
@@ -695,13 +695,13 @@ codegen_enter_scope(compiler *c, identifier name, int scope_type,
695695
* of 0. This is because RETURN_GENERATOR pushes the generator
696696
before returning. */
697697
location loc = LOCATION(lineno, lineno, -1, -1);
698-
ADDOP(c, loc, RETURN_GENERATOR);
699-
ADDOP(c, loc, POP_TOP);
698+
ADDOP_IN_SCOPE(c, loc, RETURN_GENERATOR);
699+
ADDOP_IN_SCOPE(c, loc, POP_TOP);
700700
}
701701

702-
ADDOP_I(c, loc, RESUME, RESUME_AT_FUNC_START);
702+
ADDOP_I_IN_SCOPE(c, loc, RESUME, RESUME_AT_FUNC_START);
703703
if (scope_type == COMPILE_SCOPE_MODULE) {
704-
ADDOP(c, loc, ANNOTATIONS_PLACEHOLDER);
704+
ADDOP_IN_SCOPE(c, loc, ANNOTATIONS_PLACEHOLDER);
705705
}
706706
return SUCCESS;
707707
}

0 commit comments

Comments
 (0)