Skip to content

Commit 92b493d

Browse files
committed
Fix instruction size computation for ENTER_EXECUTOR
1 parent 1c8fe9b commit 92b493d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Python/instrumentation.c

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

0 commit comments

Comments
 (0)