From 2da633c7db2bd0881a74b86b519efa18dc6ffcfe Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Fri, 28 Aug 2026 11:25:52 +0100 Subject: [PATCH] gh-156466: fix cleanup on error in codegen_function_annotations (GH-156502) (cherry picked from commit 0e2976849375fa455934246f78386740074d83b5) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Python/codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/codegen.c b/Python/codegen.c index 529c1733598e381..078ddb96269f384 100644 --- a/Python/codegen.c +++ b/Python/codegen.c @@ -1178,7 +1178,7 @@ codegen_function_annotations(compiler *c, location loc, RETURN_IF_ERROR_IN_SCOPE( c, codegen_annotations_in_scope(c, loc, args, returns, &annotations_len) ); - ADDOP_I(c, loc, BUILD_MAP, annotations_len); + ADDOP_I_IN_SCOPE(c, loc, BUILD_MAP, annotations_len); RETURN_IF_ERROR(codegen_leave_annotations_scope(c, loc)); return MAKE_FUNCTION_ANNOTATE; }