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

Coverity analysis defect 98172: Logically dead code

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.4
    • Affects Version/s: 3.3.3
    • Component/s: Storage
    • Fully Compatible
    • ALL
    • TIG 12 (04/01/16)
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      Code can never be reached because of a logical contradiction

      Defect 98172 (STATIC_C)
      Checker DEADCODE (subcategory none)
      File: /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
      Function mongo::WiredTigerIndex::fullValidate(mongo::OperationContext *, bool, long long *, mongo::ValidateResults *) const
      /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp, line: 269
      Condition "fullResults", taking true branch. Now the value of "fullResults" is not "NULL".

              if (fullResults && !WiredTigerRecoveryUnit::get(txn)->getSessionCache()->isEphemeral()) {
      

      /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp, line: 271
      At condition "fullResults", the value of "fullResults" cannot be "NULL".

                      WiredTigerUtil::verifyTable(txn, _uri, fullResults ? &(fullResults->errors) : NULL);
      

      /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp, line: 270
      The condition "fullResults" must be true.

                  int err =
      

      /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp, line: 270
      Execution cannot reach the expression "NULL" inside this statement: "err = mongo::WiredTigerUtil...".

                  int err =
      

            Assignee:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: