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

BSONObj::operator= issue with aliasing

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Client
    • None
    • ALL
    • None
    • 3
    • 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@mongodb.com Dwight Merriman
            Reporter:
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: