diff options
author | Guido van Rossum <guido@python.org> | 2023-07-25 20:01:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 20:01:02 (GMT) |
commit | 233b8782886939176982a90f563d552757cbf34e (patch) | |
tree | 8dd9337b86e8970f951461c31cc6212503aeac68 /Python/instrumentation.c | |
parent | 698b01513550798886add5e06a1c3f9a89d7dfc6 (diff) | |
download | cpython-233b8782886939176982a90f563d552757cbf34e.zip cpython-233b8782886939176982a90f563d552757cbf34e.tar.gz cpython-233b8782886939176982a90f563d552757cbf34e.tar.bz2 |
gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Python/instrumentation.c')
-rw-r--r-- | Python/instrumentation.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/instrumentation.c b/Python/instrumentation.c index e1b62bb..c3515d2 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -276,6 +276,13 @@ _PyInstruction_GetLength(PyCodeObject *code, int offset) } assert(opcode != 0); 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]); return 1 + _PyOpcode_Caches[opcode]; } |