Kaydet (Commit) 2bfed53b authored tarafından Victor Stinner's avatar Victor Stinner

Try to fix _PyTime_AsTimevalStruct_impl() on OpenBSD

It looks like the check for integer overflow doesn't work on x86 OpenBSD 5.8.
üst c3713e97
...@@ -454,7 +454,7 @@ static int ...@@ -454,7 +454,7 @@ static int
_PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv, _PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv,
_PyTime_round_t round, int raise) _PyTime_round_t round, int raise)
{ {
_PyTime_t secs; _PyTime_t secs, secs2;
int us; int us;
int res; int res;
...@@ -467,7 +467,8 @@ _PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv, ...@@ -467,7 +467,8 @@ _PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv,
#endif #endif
tv->tv_usec = us; tv->tv_usec = us;
if (res < 0 || (_PyTime_t)tv->tv_sec != secs) { secs2 = (_PyTime_t)tv->tv_sec;
if (res < 0 || secs2 != secs) {
if (raise) if (raise)
error_time_t_overflow(); error_time_t_overflow();
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment