Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23894

Coverity analysis defect 98850: Logically dead code

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.3.6
    • None
    • Storage
    • Fully Compatible
    • ALL
    • Integrate+Tuning 14 (05/13/16)

    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

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: