mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-107265: Fix code_richcompare for ENTER_EXECUTOR case (gh-108165)
This commit is contained in:
parent
04f7875c44
commit
4fdf3fda0f
2 changed files with 28 additions and 0 deletions
|
@ -1781,8 +1781,25 @@ code_richcompare(PyObject *self, PyObject *other, int op)
|
|||
for (int i = 0; i < Py_SIZE(co); i++) {
|
||||
_Py_CODEUNIT co_instr = _PyCode_CODE(co)[i];
|
||||
_Py_CODEUNIT cp_instr = _PyCode_CODE(cp)[i];
|
||||
|
||||
if (co_instr.op.code == ENTER_EXECUTOR) {
|
||||
const int exec_index = co_instr.op.arg;
|
||||
_PyExecutorObject *exec = co->co_executors->executors[exec_index];
|
||||
co_instr.op.code = exec->vm_data.opcode;
|
||||
co_instr.op.arg = exec->vm_data.oparg;
|
||||
}
|
||||
assert(co_instr.op.code != ENTER_EXECUTOR);
|
||||
co_instr.op.code = _PyOpcode_Deopt[co_instr.op.code];
|
||||
|
||||
if (cp_instr.op.code == ENTER_EXECUTOR) {
|
||||
const int exec_index = cp_instr.op.arg;
|
||||
_PyExecutorObject *exec = cp->co_executors->executors[exec_index];
|
||||
cp_instr.op.code = exec->vm_data.opcode;
|
||||
cp_instr.op.arg = exec->vm_data.oparg;
|
||||
}
|
||||
assert(cp_instr.op.code != ENTER_EXECUTOR);
|
||||
cp_instr.op.code = _PyOpcode_Deopt[cp_instr.op.code];
|
||||
|
||||
eq = co_instr.cache == cp_instr.cache;
|
||||
if (!eq) {
|
||||
goto unequal;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue