[SERVER-69278] Coverity analysis defect 123428: Using a moved object Created: 31/Aug/22  Updated: 29/Oct/23  Resolved: 06/Sep/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Gil Alon
Resolution: Fixed Votes: 0
Labels: coverity, neweng, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-31 at 10.29.57 AM.png    
Issue Links:
Problem/Incident
is caused by SERVER-62434 Implement query optimizer based on Pa... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Using a moved object

Using a moved object may lead to an unexpected/undefined behavior. An object is used after it's moved.
/src/mongo/db/query/optimizer/node.cpp:750: USE_AFTER_MOVE 123428 "distribution" is moved (indicated by "std::move(distribution)").
/src/mongo/db/query/optimizer/node.cpp:752: USE_AFTER_MOVE 123428 "distribution" is used after it has been already moved.



 Comments   
Comment by Githook User [ 02/Sep/22 ]

Author:

{'name': 'galon1', 'email': 'gil.alon@mongodb.com', 'username': 'galon1'}

Message: SERVER-69278 Use member variable to fix coverity warning object being used after move
Branch: master
https://github.com/mongodb/mongo/commit/54a15c777d6e200d3544cf102a0c250384291403

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