gh-149122: Fix refleak in codegen (GH-149179)

This commit is contained in:
Petr Viktorin 2026-04-30 12:05:48 +02:00 committed by GitHub
parent 7fe51ceae8
commit 4599335a83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3962,8 +3962,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);