8000 gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256) · python/cpython@233b878 · GitHub
[go: up one dir, main page]

Skip to content

Commit 233b878

Browse files
gvanrossumvstinner
andauthored
gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 698b015 commit 233b878

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Python/instrumentation.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ _PyInstruction_GetLength(PyCodeObject *code, int offset)
276276
}
277277
assert(opcode != 0);
278278
assert(!is_instrumented(opcode));
279+
if (opcode == ENTER_EXECUTOR) {
280+
int exec_index = _PyCode_CODE(code)[offset].op.arg;
281+
_PyExecutorObject *exec = code->co_executors->executors[exec_index];
282+
opcode = exec->vm_data.opcode;
283+
284+
}
285+
assert(opcode != ENTER_EXECUTOR);
279286
assert(opcode == _PyOpcode_Deopt[opcode]);
280287
return 1 + _PyOpcode_Caches[opcode];
281288
}

0 commit comments

Comments
 (0)
0