mirror of
https://github.com/python/cpython
synced 2024-09-16 02:09:58 +00:00
gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
698b015135
commit
233b878288
|
@ -276,6 +276,13 @@ _PyInstruction_GetLength(PyCodeObject *code, int offset)
|
||||||
}
|
}
|
||||||
assert(opcode != 0);
|
assert(opcode != 0);
|
||||||
assert(!is_instrumented(opcode));
|
assert(!is_instrumented(opcode));
|
||||||
|
if (opcode == ENTER_EXECUTOR) {
|
||||||
|
int exec_index = _PyCode_CODE(code)[offset].op.arg;
|
||||||
|
_PyExecutorObject *exec = code->co_executors->executors[exec_index];
|
||||||
|
opcode = exec->vm_data.opcode;
|
||||||
|
|
||||||
|
}
|
||||||
|
assert(opcode != ENTER_EXECUTOR);
|
||||||
assert(opcode == _PyOpcode_Deopt[opcode]);
|
assert(opcode == _PyOpcode_Deopt[opcode]);
|
||||||
return 1 + _PyOpcode_Caches[opcode];
|
return 1 + _PyOpcode_Caches[opcode];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue