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

Remove use of MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2023-04-03

    Description

      The MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE macro is not defined in our codebase. Unfortunately, we still reference it, and safety checks will change their behavior based on it.

      In particular DataRange-like types use a data serializer/deserializer template called DataType::Handler, whose default implementation guards a safety check behind MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE. This guard prevents the safety check from being evaluated. As a result, code like

        uassertStatusOK(bodyBuilder.writeAndAdvance<std::string>(reply.body));
      

      Will incorrectly compile and run, and will not load reply.body's text into the builder.

      Attachments

        Activity

          People

            billy.donahue@mongodb.com Billy Donahue
            spencer.jackson@mongodb.com Spencer Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: