Coverity analysis defect 98172: Logically dead code

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • TIG 12 (04/01/16)
    • None
    • 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 (Inactive)
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: