mirror of
https://github.com/python/cpython.git
synced 2026-05-04 09:31:02 +00:00
gh-149122: Fix segfault in compiler when certain builtin functions are passed a coroutine as arg (#149138)
This commit is contained in:
parent
4a5d25c26c
commit
16f292ef4e
3 changed files with 31 additions and 1 deletions
|
|
@ -3959,6 +3959,12 @@ maybe_optimize_function_call(compiler *c, expr_ty e, jump_target_label end)
|
|||
return 0;
|
||||
}
|
||||
|
||||
expr_ty generator_exp = asdl_seq_GET(args, 0);
|
||||
PySTEntryObject *generator_entry = _PySymtable_Lookup(SYMTABLE(c), (void *)generator_exp);
|
||||
if (generator_entry->ste_coroutine) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
location loc = LOC(func);
|
||||
|
||||
int optimized = 0;
|
||||
|
|
@ -3998,7 +4004,6 @@ maybe_optimize_function_call(compiler *c, expr_ty e, jump_target_label end)
|
|||
} else if (const_oparg == CONSTANT_BUILTIN_SET) {
|
||||
ADDOP_I(c, loc, BUILD_SET, 0);
|
||||
}
|
||||
expr_ty generator_exp = asdl_seq_GET(args, 0);
|
||||
VISIT(c, expr, generator_exp);
|
||||
|
||||
NEW_JUMP_TARGET_LABEL(c, loop);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue