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 martin.panter
Recipients martin.panter
Date 2016-08-03.05:31:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470202296.35.0.914575008379.issue27570@psf.upfronthosting.co.za>
In-reply-to
Content
Patch 3 fixes some more cases I found in the array module:

>>> a + a
Modules/arraymodule.c:809:5: runtime error: null pointer passed as argument 1, which is declared to never be null
Modules/arraymodule.c:809:5: runtime error: null pointer passed as argument 2, which is declared to never be null
Modules/arraymodule.c:810:5: runtime error: null pointer passed as argument 1, which is declared to never be null
Modules/arraymodule.c:810:5: runtime error: null pointer passed as argument 2, which is declared to never be null
array('B')
>>> a * 3
Modules/arraymodule.c:840:9: runtime error: null pointer passed as argument 1, which is declared to never be null
Modules/arraymodule.c:840:9: runtime error: null pointer passed as argument 2, which is declared to never be null
array('B')
>>> a += a
Modules/arraymodule.c:952:5: runtime error: null pointer passed as argument 1, which is declared to never be null
Modules/arraymodule.c:952:5: runtime error: null pointer passed as argument 2, which is declared to never be null

I wondered if there is a good argument for fixing these, or if it is only a theoretical problem. Apparently GCC can do optimizations about null pointer tests: <https://gcc.gnu.org/gcc-4.9/porting_to.html>. I don’t think any of the cases I found are instances of this problem, but I think fixing them helps keep the UB sanitizer output clean, so any errors causing practical behaviour problems will be easier to find.
History
Date User Action Args
2016-08-03 05:31:36martin.pantersetrecipients: + martin.panter
2016-08-03 05:31:36martin.pantersetmessageid: <1470202296.35.0.914575008379.issue27570@psf.upfronthosting.co.za>
2016-08-03 05:31:36martin.panterlinkissue27570 messages
2016-08-03 05:31:34martin.pantercreate