diff options
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index b17ab5a..998216c 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1192,11 +1192,13 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) if (freq != -1) { /* check that _PyTime_MulDiv(t, SEC_TO_NS, ticks_per_second) cannot overflow below */ +#if LONG_MAX > _PyTime_MAX / SEC_TO_NS if ((_PyTime_t)freq > _PyTime_MAX / SEC_TO_NS) { PyErr_SetString(PyExc_OverflowError, "_SC_CLK_TCK is too large"); return -1; } +#endif ticks_per_second = freq; } |