Closed
Bug 1662652
Opened 4 years ago
Closed 4 years ago
Add static analysis for non-standard quasi-move operations
Categories
(Developer Infrastructure :: Source Code Analysis, task)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox88 fixed)
RESOLVED
FIXED
88 Branch
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
There are several specific ways of using more general operations to effectively move objects:
- Via custom member functions e.g.
forget
in case of smart pointers - Via a generic swap (
std::swap
) where one of the arguments is empty or is going to be discarded - Via a custom swap (e.g.
SwapElements
for arrays) where one of the arguments is empty or is going to be discarded
Not using std::move
may have various disadvantages, including:
- The generated code may be suboptimal since the operations used are more general
- The source code is harder to understand since other concepts are used in place of standard move semantics
While Bug 1611415 removed many occurrences of the first item based on a preliminary version of a static analysis (that still produced many false positives), and several occurrences of the last item were removed manually in Bug 1654992, an improved static analysis could identify the remaining occurrences and prevent the introduction of new ones.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/00da6a4af3b8
New non-standard move checker. r=andi
Comment 3•4 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox88:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•