Coverity analysis defect 72778: Logically dead code

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Fully Compatible
    • ALL
    • Sharding A (10/09/15)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Code can never be reached because of a logical contradiction

      Defect 72778 (STATIC_C)
      Checker DEADCODE (subcategory none)
      File: /src/mongo/s/version_manager.cpp
      Function mongo::checkShardVersion(mongo::DBClientBase *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::shared_ptr<mongo::ChunkManager>, bool, int)
      /src/mongo/s/version_manager.cpp, line: 436
      At condition "(bool)1L", the value of "1L" must be between 0 and 1.

                  massert( 10429 , errmsg , 0 );
      

      /src/mongo/s/version_manager.cpp, line: 436
      The condition "(bool)1L" must be true.

                  massert( 10429 , errmsg , 0 );
      

      /src/mongo/s/version_manager.cpp, line: 437
      Execution cannot reach this statement: "return true;".

                  return true;
      

              Assignee:
              Unassigned
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: