Message256256
I found this while writing up a separate bug (CPython doesn't use static analysis!).
In _ctypes/cfield.c, Z_set has a bug of some sort:
if (PyLong_Check(value) || PyLong_Check(value)) {
See: https://hg.python.org/cpython/file/tip/Modules/_ctypes/cfield.c#l1378
...which has been there for at least 5 years: https://hg.python.org/cpython/rev/cab14be0ada1
I'm not sure what the original programmer meant - it's been around forever & I don't know what was there before it - but PyLong_Check(value) is evaluated twice. Which doesn't really make sense.
Compiling with /analyze found this quite easily:
c:\pythondev\repo\modules\_ctypes\cfield.c(1378): warning C6287: Redundant code: the left and right sub-expressions are identical.
There's a similar issue in P_set, at line 1486. |
|
Date |
User |
Action |
Args |
2015-12-12 04:50:49 | Alexander Riccio | set | recipients:
+ Alexander Riccio, amaury.forgeotdarc, belopolsky, meador.inge |
2015-12-12 04:50:49 | Alexander Riccio | set | messageid: <1449895849.48.0.817393868037.issue25845@psf.upfronthosting.co.za> |
2015-12-12 04:50:49 | Alexander Riccio | link | issue25845 messages |
2015-12-12 04:50:48 | Alexander Riccio | create | |
|