[SERVER-68788] Coverity analysis defect 122654: Using a moved object Created: 12/Aug/22  Updated: 29/Oct/23  Resolved: 12/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: Will Buerger
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-12 at 10.17.34 AM.png    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-09-19
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/exec/sbe/stages/collection_helpers.cpp:47: USE_AFTER_MOVE 122654 "collPtr" is moved (indicated by "std::move(collPtr)").
/src/mongo/db/exec/sbe/stages/collection_helpers.cpp:47: USE_AFTER_MOVE 122654 "collPtr" is used after it has been already moved.



 Comments   
Comment by Githook User [ 30/Aug/22 ]

Author:

{'name': 'Will Buerger', 'email': 'will.buerger@mongodb.com', 'username': 'wbuerger46'}

Message: SERVER-68788 Coverity analysis defect 122654: Using a moved object
Branch: master
https://github.com/mongodb/mongo/commit/6fbccbff53e97e48e3813f4fa1197b2513ae5fdb

Comment by Kyle Suarez [ 12/Aug/22 ]

cf. https://en.cppreference.com/w/cpp/language/eval_order

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