mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-128534: Fix behavior of branch monitoring for async for
(GH-130847)
* Both branches in a pair now have a common source and are included in co_branches
This commit is contained in:
parent
e5527f2cdd
commit
89df62c120
17 changed files with 235 additions and 154 deletions
|
@ -849,7 +849,7 @@ calculate_stackdepth(cfg_builder *g)
|
|||
goto error;
|
||||
}
|
||||
maxdepth = Py_MAX(maxdepth, depth + effects.max);
|
||||
if (HAS_TARGET(instr->i_opcode)) {
|
||||
if (HAS_TARGET(instr->i_opcode) && instr->i_opcode != END_ASYNC_FOR) {
|
||||
if (get_stack_effects(instr->i_opcode, instr->i_oparg, 1, &effects) < 0) {
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"Invalid stack effect for opcode=%d, arg=%i",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue