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.

Author gregory.p.smith
Recipients gregory.p.smith, gvanrossum, lys.nikolaou, p-ganssle
Date 2020-06-20.18:56:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592679391.13.0.913540149945.issue41059@roundup.psfhosted.org>
In-reply-to
Content
Here's an example:

*** CID 1464688:  Control flow issues  (DEADCODE)
/Parser/parser.c: 24243 in _tmp_147_rule()
24237                 &&
24238                 (z = disjunction_rule(p))  // disjunction
24239             )
24240             {
24241                 D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
24242                 _res = z;
>>>     CID 1464688:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "PyErr_Occurred()" inside this statement: "if (_res == NULL && PyErr_O...".
24243                 if (_res == NULL && PyErr_Occurred()) {
24244                     p->error_indicator = 1;
24245                     D(p->level--);
24246                     return NULL;
24247                 }
24248                 goto done;


A lot of them are of that form, which seems harmless if they are true - it means a compiler may deduce the same thing and omit code generation for an impossible to trigger error block.  OTOH this could just be a weakness in the scanner.  (i don't know how to silence it via markers in the code, but i assume it is possible)

You'll need to login to Coverity to see the full report.   https://scan.coverity.com/projects/python?tab=overview.
(it has been ages since i've logged in, they appear to support Github logins now.  yay.)

As the parser.c code is new for 3.9, I'm marking this as deferred blocker.  We should pay closer attention to the reports and update the parser generator code to generate code that passes analysis cleanly before we exit the beta phase.
History
Date User Action Args
2020-06-20 18:56:31gregory.p.smithsetrecipients: + gregory.p.smith, gvanrossum, p-ganssle, lys.nikolaou
2020-06-20 18:56:31gregory.p.smithsetmessageid: <1592679391.13.0.913540149945.issue41059@roundup.psfhosted.org>
2020-06-20 18:56:31gregory.p.smithlinkissue41059 messages
2020-06-20 18:56:30gregory.p.smithcreate