From 0e63adbbc0655601adeba6c2a41567899cf0b6ed 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 d13f8419a61bcd0..0587a81491353c2 100644 --- a/Python/codegen.c +++ b/Python/codegen.c @@ -1138,7 +1138,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; }