diff --git a/Modules/_remote_debugging/threads.c b/Modules/_remote_debugging/threads.c index 953c8a383f0..f564e3a7256 100644 --- a/Modules/_remote_debugging/threads.c +++ b/Modules/_remote_debugging/threads.c @@ -405,7 +405,8 @@ unwind_stack_for_thread( goto error; } // Update last_profiled_frame for next sample - uintptr_t lpf_addr = *current_tstate + unwinder->debug_offsets.thread_state.last_profiled_frame; + uintptr_t lpf_addr = + *current_tstate + (uintptr_t)unwinder->debug_offsets.thread_state.last_profiled_frame; if (_Py_RemoteDebug_WriteRemoteMemory(&unwinder->handle, lpf_addr, sizeof(uintptr_t), &frame_addr) < 0) { PyErr_Clear(); // Non-fatal