[SERVER-75542] Coverity analysis defect 136596: Copy without assign Created: 31/Mar/23  Updated: 29/Oct/23  Resolved: 01/May/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc1

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-03-31 at 9.55.52 AM.png    
Issue Links:
Backports
Problem/Incident
is caused by SERVER-75229 Add mini-bloom filter to MakeObjSpec Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: QE 2023-05-15
Participants:

 Description   

Copy without assign
src/mongo/db/exec/sbe/values/makeobj_spec.h:41

This class has a user-defined copy constructor but no user-defined assignment operator. If the copy constructor is necessary to manage owned resources then a corresponding assignment operator is usually required. If an object of this type is assigned memory leaks and/or use-after-free errors may occur. Note that a compiler-generated assignment operator will perform only a bit-wise copy for any fields that do not have their own assignment operators defined. Class has user-written copy constructor but no user-written assignment operator
/src/mongo/db/exec/sbe/values/makeobj_spec.h:41: COPY_WITHOUT_ASSIGN 136596 Class "mongo::sbe::value::MakeObjSpec" has a user-written copy constructor "mongo::sbe::value::MakeObjSpec::MakeObjSpec(mongo::sbe::value::MakeObjSpec const &)" but no corresponding user-written assignment operator.
/src/mongo/db/exec/sbe/values/makeobj_spec.h:53: COPY_WITHOUT_ASSIGN 136596 User-written copy constructor.



 Comments   
Comment by Githook User [ 10/May/23 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-75542: Fix Coverity analysis defect 136596: Copy without assign

(cherry picked from commit 8364c9222cd948099fe71daba22ce162c8cf15a2)
Branch: v7.0
https://github.com/mongodb/mongo/commit/bad232ed1392e3a0e2670acb2e329c0acd254ab3

Comment by Githook User [ 28/Apr/23 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-75542: Fix Coverity analysis defect 136596: Copy without assign
Branch: master
https://github.com/mongodb/mongo/commit/8364c9222cd948099fe71daba22ce162c8cf15a2

Generated at Thu Feb 08 06:30:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.