[SERVER-68986] Coverity analysis defect 122748: Logically dead code Created: 19/Aug/22  Updated: 29/Oct/23  Resolved: 07/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Mindaugas Malinauskas
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-19 at 10.45.22 AM.png    
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-09-19
Participants:

 Description   

Logically dead code

The indicated dead code may have performed some action; that action will never occur. Code can never be reached because of a logical contradiction
/src/mongo/db/query/sbe_stage_builder_expression.cpp:1413: DEADCODE 122748 Condition "eIsoWeekYear.operator bool()", taking true branch. Now the value of "eIsoWeekYear" is not "nullptr".
/src/mongo/db/query/sbe_stage_builder_expression.cpp:1520: DEADCODE 122748 At condition "eIsoWeekYear.operator bool()", the value of "eIsoWeekYear" cannot be "nullptr".
/src/mongo/db/query/sbe_stage_builder_expression.cpp:1520: DEADCODE 122748 The condition "!eIsoWeekYear.operator bool()" cannot be true.
/src/mongo/db/query/sbe_stage_builder_expression.cpp:1521: DEADCODE 122748 Execution cannot reach the expression "(eIsoWeekYear) = (std::unique_ptr<mongo::sbe::EExpression, std::default_delete<mongo::sbe::EExpression> >(mongo::sbe::makeE(mongo::sbe::value::TypeTags(mongo::sbe::value::TypeTags::NumberInt32), mongo::sbe::value::Value(mongo::sbe::value::bitcastFrom(1970)))))" inside this statement: "(eIsoWeekYear) = (std::uniq...".



 Comments   
Comment by Githook User [ 06/Sep/22 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-68986 Removed dead code from SBE implementation of $dateFromParts aggregation expression
Branch: master
https://github.com/mongodb/mongo/commit/6d79b46321ab98044e681def7cfacf071d79ac40

Generated at Thu Feb 08 06:12:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.