[SERVER-71762] Coverity analysis defect 134254: Using a moved object Created: 01/Dec/22  Updated: 09/Dec/22  Resolved: 09/Dec/22

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: Alya Berciu
Resolution: Duplicate Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-12-01 at 9.50.14 AM.png    
Issue Links:
Depends
depends on SERVER-71310 Validate histograms Closed
Duplicate
duplicates SERVER-71310 Validate histograms Closed
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/stats/scalar_histogram.cpp:97: USE_AFTER_MOVE 134254 "buckets" is moved (indicated by "std::move(buckets)").
/src/mongo/db/query/stats/scalar_histogram.cpp:98: USE_AFTER_MOVE 134254 "buckets" is used after it has been already moved.



 Comments   
Comment by Alya Berciu [ 09/Dec/22 ]

Closing as a duplicate since this was fixed by SERVER-71310.

Comment by Alya Berciu [ 01/Dec/22 ]

This should be fixed as part of SERVER-71310.

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