[SERVER-70986] Coverity analysis defect 134061: Redundant test Created: 01/Nov/22  Updated: 29/Oct/23  Resolved: 02/Nov/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Redundant test

By the time the program execution reaches the test of this condition there is only one possible outcome for the test. The code at the destination of this branch is not dead, either because this condition is always true or because there is at least one other branch that reaches it. Test always evaluates the same
/src/mongo/db/pipeline/abt/utils.cpp:101: DEADCODE 134061 Condition "fieldPathLength >= 2UL", taking true branch. Now the value of "fieldPathLength" is at least 2.
/src/mongo/db/pipeline/abt/utils.cpp:101: DEADCODE 134061 Condition "fieldPathLength >= 2UL", taking false branch. Now the value of "fieldPathLength" is equal to 1.
/src/mongo/db/pipeline/abt/utils.cpp:97: DEADCODE 134061 At condition "fieldPathLength > 0UL", the value of "fieldPathLength" must be at least 1.
/src/mongo/db/pipeline/abt/utils.cpp:97: DEADCODE 134061 At condition "fieldPathLength > 0UL", the value of "fieldPathLength" cannot be equal to 0.
/src/mongo/db/pipeline/abt/utils.cpp:90: DEADCODE 134061 Condition "fieldPathLength == 0UL", taking false branch. Now the value of "fieldPathLength" is at least 1.
/src/mongo/db/pipeline/abt/utils.cpp:90: DEADCODE 134061 Condition "fieldPathLength == 0UL", taking false branch. Now the value of "fieldPathLength" cannot be equal to 0.
/src/mongo/db/pipeline/abt/utils.cpp:97: DEADCODE 134061 The condition "fieldPathLength > 0UL" must be true.



 Comments   
Comment by Githook User [ 02/Nov/22 ]

Author:

{'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-70986 Remove dead code check in ABT translation
Branch: master
https://github.com/mongodb/mongo/commit/4918766c688e86274aaade30f8e637415df13ba7

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