Skip to content

Commit 55d9d2b

Browse files
committed
Fix reference leak when encountering error during compilation of function body.
1 parent 58136c7 commit 55d9d2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
22762276
c->u->u_posonlyargcount = asdl_seq_LEN(args->posonlyargs);
22772277
c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs);
22782278
for (i = docstring ? 1 : 0; i < asdl_seq_LEN(body); i++) {
2279-
VISIT(c, stmt, (stmt_ty)asdl_seq_GET(body, i));
2279+
VISIT_IN_SCOPE(c, stmt, (stmt_ty)asdl_seq_GET(body, i));
22802280
}
22812281
co = assemble(c, 1);
22822282
qualname = c->u->u_qualname;

0 commit comments

Comments
 (0)