Mark Dickinson <dicki...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to