[SERVER-3191] BSONObj::operator= issue with aliasing Created: 03/Jun/11  Updated: 29/Aug/11  Resolved: 03/Jun/11

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Dwight Merriman Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 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.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 03/Jun/11 ]

I actually things are correct as is and this was just a bug in the code using it.

Generated at Thu Feb 08 03:02:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.