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

Coverity analysis defect 105088: Redundant test

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.5
    • Affects Version/s: None
    • Component/s: Storage
    • Fully Compatible
    • ALL
    • Storage NYC 2018-11-05
    • 1

      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))) {
      

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: