[SERVER-23894] Coverity analysis defect 98850: Logically dead code Created: 25/Apr/16  Updated: 16/May/16  Resolved: 27/Apr/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.3.6

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Integrate+Tuning 14 (05/13/16)
Participants:

 Description   

Code can never be reached because of a logical contradiction

Defect 98850 (STATIC_C)
Checker DEADCODE (subcategory none)
File: /src/mongo/db/storage/key_string.cpp
Function mongo::KeyString::_appendNumberDecimal(mongo::Decimal128, bool)
/src/mongo/db/storage/key_string.cpp, line: 703
Condition "hasFraction", taking true branch. Now the value of "hasFraction" is equal to 1.

            if (!hasFraction)

/src/mongo/db/storage/key_string.cpp, line: 708
At condition "hasFraction", the value of "hasFraction" must be equal to 1.

                uint8_t dcm = hasFraction ? kDCMHasContinuationLargerThanDoubleRoundedUpTo15Digits

/src/mongo/db/storage/key_string.cpp, line: 708
The condition "hasFraction" must be true.

                uint8_t dcm = hasFraction ? kDCMHasContinuationLargerThanDoubleRoundedUpTo15Digits

/src/mongo/db/storage/key_string.cpp, line: 708
Execution cannot reach the expression "mongo::KeyString::kDCMEqualToDouble" inside this statement: "dcm = (hasFraction ? mongo:...".

                uint8_t dcm = hasFraction ? kDCMHasContinuationLargerThanDoubleRoundedUpTo15Digits



 Comments   
Comment by Githook User [ 27/Apr/16 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-23894 Coverity analysis defect 98850: Logically dead code
Branch: master
https://github.com/mongodb/mongo/commit/fe35b1572b89289c2005a162ee859999ade5bcae

Generated at Thu Feb 08 04:04:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.