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 dilyan.palauzov, mark.dickinson
Date 2017-05-07.06:59:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494140348.09.0.77966823276.issue30287@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for this. I took a look at the 5 reports for Objects/longobject.c, and I don't think there's any action to be taken on any of them. (Two false positives; two "dead assignments" that are used when asserts are enabled, and one division-by-zero that depends on a function being called in a way that never happens in practice.)

* Objects/longobject.c:2823 Assigned value is garbage or undefined

This is a false positive. Here we have:

    a_bits <= a_size * PyLongShift
    shift_digits = (a_bits - DBL_MANT_DIG - 2) / PyLong_SHIFT;

and then we call v_rshift(x_digits, ..., a_size - shift_digits, ...), which fills the first a_size - shift_digits entries of x_digits. Since DBL_MANT_DIG >= PyLong_SHIFT, we have shift_digits < a_size, so x_digits[0] is always initialised by v_rshift.

* Objects/longobject.c:2723 Dead assignment

The value of the assignment is used in a following assert statement; I don't think this should be changed.

* Objects/longobject.c:2463 Dead assignment

Again, the value of the assignment is used in an assert.

* Objects/longobject.c:1828 Division by zero

This function will never get called with bits=0. There are asserts to check this.

* Objects/longobject.c:2830 Assigned value is garbage or undefined

This is another false positive, similar to the first one. Analysing the arithmetic shows that x_digits[0] is always defined.
History
Date User Action Args
2017-05-07 06:59:08mark.dickinsonsetrecipients: + mark.dickinson, dilyan.palauzov
2017-05-07 06:59:08mark.dickinsonsetmessageid: <1494140348.09.0.77966823276.issue30287@psf.upfronthosting.co.za>
2017-05-07 06:59:08mark.dickinsonlinkissue30287 messages
2017-05-07 06:59:07mark.dickinsoncreate