[3.14] gh-149122: Fix refleak in codegen (GH-149179) (#149181)

gh-149122: Fix refleak in codegen (GH-149179)
(cherry picked from commit 4599335a83)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Miss Islington (bot)
2026-04-30 15:12:52 +02:00
committed by GitHub
parent ab2d84fe10
commit bfcaeead9f
+2
View File
@@ -3864,8 +3864,10 @@ maybe_optimize_function_call(compiler *c, expr_ty e, jump_target_label end)
expr_ty generator_exp = asdl_seq_GET(args, 0);
PySTEntryObject *generator_entry = _PySymtable_Lookup(SYMTABLE(c), (void *)generator_exp);
if (generator_entry->ste_coroutine) {
Py_DECREF(generator_entry);
return 0;
}
Py_DECREF(generator_entry);
location loc = LOC(func);