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

BSONObj::operator= issue with aliasing

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Client
    • None
    • ALL

    Description

      the following was failing:

      • after = after["opcounters"].Obj();
        this worked:
        + after = after["opcounters"].Obj().copy();

      After was 'owned'. i'm guessing there is an issue with assignment of bsonobj's and aliasing – i.e. when one assigns to one's self. I don't really understand the Holder class so if aaron can fix that would be great.

      Ideally we would not slow things down with checks or things as this almost never happens. if there is a solution that maintains speed, great; if not if we can dassert on aliased assignment that would work well. note lhs.this != rhs.this as the object on the rhs is a subobject.

      Attachments

        Activity

          People

            dwight@mongodb.com Dwight Merriman
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: