[SERVER-60199] Coverity analysis defect 120812: Redundant test Created: 24/Sep/21  Updated: 29/Oct/23  Resolved: 02/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc3

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

Attachments: PNG File Screen Shot 2021-09-24 at 10.21.14 AM.png    
Issue Links:
Related
is related to SERVER-48076 implicit conversion from 'long long' ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-10-04, Execution Team 2021-10-18, Execution Team 2021-11-01, Execution Team 2021-11-15
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/bson/bsonelement.h:1061: DEADCODE 120812 At condition "sameMax", the value of "sameMax" must be equal to 1.
/src/mongo/bson/bsonelement.h:1060: DEADCODE 120812 Condition "sameMax", taking true branch. Now the value of "sameMax" is equal to 1.
/src/mongo/bson/bsonelement.h:1059: DEADCODE 120812 Assigning: "sameMax" = "true".
/src/mongo/bson/bsonelement.h:1060: DEADCODE 120812 The condition "sameMax" must be true.



 Comments   
Comment by Githook User [ 29/Oct/21 ]

Author:

{'name': 'Gabriel Marks', 'email': 'gabriel.marks@mongodb.com', 'username': 'marksg07'}

Message: SERVER-60199 Attempt to fix Coverity defect
Branch: master
https://github.com/mongodb/mongo/commit/83b2c0ddd983c0a685ca91fe545930723b3e13fe

Generated at Thu Feb 08 05:49:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.