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

Coverity analysis defect 105088: Redundant test

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.5
    • Component/s: Storage
    • Labels:

      Description

      Test always evaluates the same

      Defect 105088 (STATIC_C)
      Checker DEADCODE (subcategory redundant_test)
      File: /src/mongo/db/storage/biggie/store.h
      Function mongo::biggie::RadixStore<std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::_merge3Helper(mongo::biggie::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Node *, const mongo::biggie::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Node *, const mongo::biggie::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Node *, std::vector<mongo::biggie::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Node *, std::allocator<mongo::biggie::RadixStore<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Node *>> &, std::vector<unsigned char, std::allocator<unsigned char>>&)
      /src/mongo/db/storage/biggie/store.h, line: 1337
      At condition "baseNode", the value of "baseNode" cannot be "NULL".

                          } else if (baseNode && (!otherNode || (otherNode && baseNode != otherNode))) {

      /src/mongo/db/storage/biggie/store.h, line: 1312
      Condition "baseNode", taking true branch. Now the value of "baseNode" is not "NULL".

                      if (!node && !baseNode && !otherNode)

      /src/mongo/db/storage/biggie/store.h, line: 1337
      The condition "baseNode" must be true.

                          } else if (baseNode && (!otherNode || (otherNode && baseNode != otherNode))) {

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: