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

Created on 2013-07-24 19:20 by christian.heimes, last changed 2013-07-25 09:48 by christian.heimes. 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) 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
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