mirror of
https://github.com/python/cpython.git
synced 2026-06-19 08:02:29 +00:00
gh-137030: Fix YIELD_VALUE bytecode assertion (#149184)
(cherry picked from commit 952784af47)
Co-authored-by: Mark Shannon <mark@hotpy.org>
This commit is contained in:
parent
96b81d527c
commit
690b2bb615
5 changed files with 28 additions and 30 deletions
13
Python/executor_cases.c.h
generated
13
Python/executor_cases.c.h
generated
|
|
@ -1975,13 +1975,12 @@
|
|||
frame = tstate->current_frame = frame->previous;
|
||||
gen_frame->previous = NULL;
|
||||
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
|
||||
#if TIER_ONE
|
||||
assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE ||
|
||||
frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION ||
|
||||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
|
||||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER ||
|
||||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT ||
|
||||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
|
||||
#if TIER_ONE && defined(Py_DEBUG)
|
||||
if (!PyStackRef_IsNone(frame->f_executable)) {
|
||||
int i = frame->instr_ptr - _PyFrame_GetBytecode(frame);
|
||||
int opcode = _Py_GetBaseCodeUnit(_PyFrame_GetCode(frame), i).op.code;
|
||||
assert(opcode == SEND || opcode == FOR_ITER);
|
||||
}
|
||||
#endif
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue