Message271874
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. |
|
Date |
User |
Action |
Args |
2016-08-03 05:31:36 | martin.panter | set | recipients:
+ martin.panter |
2016-08-03 05:31:36 | martin.panter | set | messageid: <1470202296.35.0.914575008379.issue27570@psf.upfronthosting.co.za> |
2016-08-03 05:31:36 | martin.panter | link | issue27570 messages |
2016-08-03 05:31:34 | martin.panter | create | |
|