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

Coverity analysis defect 119982: 'Constant' variable guards dead code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      'Constant' variable guards dead code

      A variable being assigned only once may be intentionally guarding disabled code, or it may represent incomplete logic where a missing assignment would make the variable not be constant. Variable assigned once to a constant guards dead code.
      /src/mongo/db/write_concern.cpp:97: DEADCODE 119982 Assigning: "getLastErrorDefaultsWasApplied" = "false".
      /src/mongo/db/write_concern.cpp:142: DEADCODE 119982 At condition "getLastErrorDefaultsWasApplied", the value of "getLastErrorDefaultsWasApplied" must be equal to 0.
      /src/mongo/db/write_concern.cpp:142: DEADCODE 119982 The condition "getLastErrorDefaultsWasApplied" cannot be true.
      /src/mongo/db/write_concern.cpp:143: DEADCODE 119982 Execution cannot reach the expression "provenance->setSource(boost::optional<mongo::ReadWriteConcernProvenanceSourceEnum>(mongo::ReadWriteConcernProvenanceSourceEnum(mongo::ReadWriteConcernProvenanceSourceEnum::getLastErrorDefaults)))" inside this statement: "provenance->setSource(boost...".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              huayu.ouyang Huayu Ouyang
              Reporter:
              xgen-internal-coverity Coverity Collector User
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: