mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
GH-118095: Handle RETURN_GENERATOR
in tier 2 (GH-118180)
This commit is contained in:
parent
10bb90ed49
commit
f180b31e76
16 changed files with 143 additions and 81 deletions
|
@ -697,7 +697,8 @@ top: // Jump here after _PUSH_FRAME or likely branches
|
|||
// Reserve space for nuops (+ _SET_IP + _EXIT_TRACE)
|
||||
int nuops = expansion->nuops;
|
||||
RESERVE(nuops + 1); /* One extra for exit */
|
||||
if (expansion->uops[nuops-1].uop == _POP_FRAME) {
|
||||
int16_t last_op = expansion->uops[nuops-1].uop;
|
||||
if (last_op == _POP_FRAME || last_op == _RETURN_GENERATOR) {
|
||||
// Check for trace stack underflow now:
|
||||
// We can't bail e.g. in the middle of
|
||||
// LOAD_CONST + _POP_FRAME.
|
||||
|
@ -756,7 +757,7 @@ top: // Jump here after _PUSH_FRAME or likely branches
|
|||
Py_FatalError("garbled expansion");
|
||||
}
|
||||
|
||||
if (uop == _POP_FRAME) {
|
||||
if (uop == _POP_FRAME || uop == _RETURN_GENERATOR) {
|
||||
TRACE_STACK_POP();
|
||||
/* Set the operand to the function or code object returned to,
|
||||
* to assist optimization passes. (See _PUSH_FRAME below.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue