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

Coverity analysis defect 105090: Wrong operator used

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2018-12-03, Sharding 2018-12-17

      Description

      Wrong operator used in expression

      Defect 105090 (STATIC_C)
      Checker CONSTANT_EXPRESSION_RESULT (subcategory operator_confusion)
      File: /src/mongo/db/write_concern.cpp
      Function mongo::extractWriteConcern(mongo::OperationContext *, const mongo::BSONObj &)
      /src/mongo/db/write_concern.cpp, line: 85
      "opCtx->getClient()>session()>getTags() | 2U /* mongo::transport::Session::kInternalClient */" is always 1/true regardless of the values of its operand. This occurs as the logical second operand of "&&".

                  (opCtx->getClient()->session()->getTags() | transport::Session::kInternalClient)) {

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: