[SERVER-15073] Coverity analysis defect 30005: Unsafe assignment operator Created: 28/Aug/14  Updated: 06/Sep/14  Resolved: 06/Sep/14

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

A new defect has been detected and assigned to milkie in Coverity Connect.
http://coverity.mongodb.com//sourcebrowser.htm?projectId=10001#mergedDefectId=30005
The defect was flagged by checker SELF_ASSIGN in
file /src/mongo/base/status-inl.h
function mongo::Status::operator =(const mongo::Status&)
and this ticket was created by milkie



 Comments   
Comment by Andrew Morrow (Inactive) [ 06/Sep/14 ]

The copy ctor as written is self assign safe because it ups the recount on other before lowering it on self. No check of address of other is required.

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