mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)
This commit is contained in:
parent
0f797402bc
commit
5b05d452cd
9 changed files with 92 additions and 16 deletions
|
@ -704,7 +704,7 @@ top: // Jump here after _PUSH_FRAME or likely branches
|
|||
int nuops = expansion->nuops;
|
||||
RESERVE(nuops + 1); /* One extra for exit */
|
||||
int16_t last_op = expansion->uops[nuops-1].uop;
|
||||
if (last_op == _POP_FRAME || last_op == _RETURN_GENERATOR) {
|
||||
if (last_op == _POP_FRAME || last_op == _RETURN_GENERATOR || last_op == _YIELD_VALUE) {
|
||||
// Check for trace stack underflow now:
|
||||
// We can't bail e.g. in the middle of
|
||||
// LOAD_CONST + _POP_FRAME.
|
||||
|
@ -763,7 +763,7 @@ top: // Jump here after _PUSH_FRAME or likely branches
|
|||
Py_FatalError("garbled expansion");
|
||||
}
|
||||
|
||||
if (uop == _POP_FRAME || uop == _RETURN_GENERATOR) {
|
||||
if (uop == _POP_FRAME || uop == _RETURN_GENERATOR || uop == _YIELD_VALUE) {
|
||||
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