From: Guido van Rossum Date: Tue, 25 Jul 2023 20:01:02 +0000 (-0700) Subject: gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256) X-Git-Tag: v3.13.0a1~1206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=233b8782886939176982a90f563d552757cbf34e;p=thirdparty%2FPython%2Fcpython.git gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256) Co-authored-by: Victor Stinner --- diff --git a/Python/instrumentation.c b/Python/instrumentation.c index e1b62bb32ec8..c3515d2c5a3a 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]; }