BSONObj::operator= issue with aliasing

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Client
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Dwight Merriman
            Reporter:
            Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: