This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, petdance, vstinner
Date 2020-05-01.16:08:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588349321.11.0.468948336038.issue40455@roundup.psfhosted.org>
In-reply-to
Content
As to _why_ it's a false positive: at that point in the code, assuming 30-bit limbs and an IEEE 754 binary64 "double", we have (using Python notation for floor division)

    a_size == 1 + (a_bits - 1) // 30

and

    shift_digits == (a_bits - 55) // 30

from which it's clear that

    shift_digits <= (a_bits - 1) // 30 < a_size

so a_size - shift_digits is always strictly positive.

The above doesn't depend on the precise values 55 and 30 - any other positive values would have worked, so even with 15-bit digits and some other double format with fewer bits, we still have "shift_digits < a_size".

And now since the v_rshift call writes "a_size - shift_digits" digits to x, we're guaranteed that at least one digit is written, so `x[0]` is not uninitialised.
History
Date User Action Args
2020-05-01 16:08:41mark.dickinsonsetrecipients: + mark.dickinson, vstinner, petdance
2020-05-01 16:08:41mark.dickinsonsetmessageid: <1588349321.11.0.468948336038.issue40455@roundup.psfhosted.org>
2020-05-01 16:08:41mark.dickinsonlinkissue40455 messages
2020-05-01 16:08:40mark.dickinsoncreate