Skip to content
5 changes: 3 additions & 2 deletions Python/instrumentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,8 +1235,9 @@ _Py_call_instrumentation_jump(
assert(event == PY_MONITORING_EVENT_JUMP ||
event == PY_MONITORING_EVENT_BRANCH_RIGHT ||
event == PY_MONITORING_EVENT_BRANCH_LEFT);
int to = (int)(dest - _PyFrame_GetBytecode(frame));
PyObject *to_obj = PyLong_FromLong(to * (int)sizeof(_Py_CODEUNIT));
Py_ssize_t to = (dest - _PyFrame_GetBytecode(frame));
assert(to <= PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(_Py_CODEUNIT));
PyObject *to_obj = PyLong_FromSsize_t(to * sizeof(_Py_CODEUNIT));
if (to_obj == NULL) {
return NULL;
}
Expand Down
Loading