Issue 24302: Dead Code of Handler check in function faulthandler_fatal_error() (original) (raw)

Issue24302

Created on 2015-05-27 16:30 by pankaj.s01, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Python-3.4.3-faulthandler.patch pankaj.s01,2015-05-27 16:30 Modules/faulthandler.c
Messages (2)
msg244195 - (view) Author: Pankaj Sharma (pankaj.s01) * Date: 2015-05-27 16:30
Hi, There is dead code reported in this issue and I think no need to check for NULL of 'handler' in function faulthandler_fatal_error() and file Python-3.4.3/Modules/faulthandler.c . where 'handler' is pointed to staic array faulthandler_handlers[] which never will be null inside loop with faulthandler_nsignals value and doesn't means to check for NULL outside of loop. but if there is possibility of 'handler' to be NULL then it should be check inside the loop until handler->signum is not equal to signum and then break;
msg247264 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-07-24 08:36
The check is required to fix a compiler warning. Please keep it, it doesn't bite. Maybe add a comment to explain it.
History
Date User Action Args
2022-04-11 14:58:17 admin set github: 68490
2019-10-16 23:11:05 vstinner set status: open -> closedresolution: not a bugstage: resolved
2015-07-24 08:36:17 vstinner set messages: +
2015-07-24 05:46:42 pankaj.s01 set nosy: + benjamin.peterson
2015-05-27 17:34:50 r.david.murray set nosy: + vstinner
2015-05-27 16:30:45 pankaj.s01 create