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.

classification
Title: Dead code in socket_ntohl()
Type: behavior Stage: resolved
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2013-07-24 19:20 by christian.heimes, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg193669 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-24 19:20
http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l4642

The code has two checks if (x == (unsigned long) -1 && PyErr_Occurred()). Coverity claims that the second time is dead code and I agree. It looks like an artifact from the time the function didn't check for integer overflow. CID 982369
msg193688 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-07-25 06:33
Agree, it can be removed.
msg193690 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-25 09:47
New changeset b7ea3f94f6ca by Christian Heimes in branch '3.3':
Issue #18549: Eliminate dead code in socket_ntohl().
http://hg.python.org/cpython/rev/b7ea3f94f6ca

New changeset 2a59428dbff5 by Christian Heimes in branch 'default':
Issue #18549: Eliminate dead code in socket_ntohl().
http://hg.python.org/cpython/rev/2a59428dbff5
msg193691 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-25 09:48
Thanks for the review!
History
Date User Action Args
2022-04-11 14:57:48adminsetgithub: 62749
2013-07-25 09:48:00christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg193691

stage: needs patch -> resolved
2013-07-25 09:47:35python-devsetnosy: + python-dev
messages: + msg193690
2013-07-25 06:33:52serhiy.storchakasetmessages: + msg193688
2013-07-24 19:20:10christian.heimescreate