]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
faulthandler: use _PyTime_t rather than double for timeout (#4139)
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 27 Oct 2017 14:27:12 +0000 (07:27 -0700)
committerGitHub <noreply@github.com>
Fri, 27 Oct 2017 14:27:12 +0000 (07:27 -0700)
commit93fd478231bba0c00a3561ea8db31774909ec714
treece29df5e9b40737873ecf42bfa5ccedda02bc899
parent7351f9e5a91c403d15c6d556f9989b443f1296f9
faulthandler: use _PyTime_t rather than double for timeout (#4139)

Use the _PyTime_t type rather than double for the faulthandler
timeout in dump_traceback_later().

This change should fix the following Coverity warning:

CID 1420311:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
Dividing integer expressions "9223372036854775807LL" and "1000LL",
and then converting the integer quotient to type "double". Any
remainder, or fractional part of the quotient, is ignored.

    if ((timeout * 1e6) >= (double) PY_TIMEOUT_MAX) {

The warning comes from (double)PY_TIMEOUT_MAX with:

    #define PY_TIMEOUT_MAX (PY_LLONG_MAX / 1000)
Modules/faulthandler.c