Closed
Bug 1335000
Opened 8 years ago
Closed 8 years ago
[Static Analysis] Operator= should return a OwningUnrestrictedDoubleOrString&
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Codechecker detected that operator= should return a OwningUnrestrictedDoubleOrString&
https://dxr.mozilla.org/mozilla-central/source/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/UnionTypes.h#14247
By having it return void we suppress the usage of expressions like:
a = b = c
Comment hidden (mozreview-request) |
Updated•8 years ago
|
Attachment #8831684 -
Flags: review?(amarchesini) → review?(peterv)
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8831684 [details]
Bug 1335000 - return type& for copy assignment operator.
https://reviewboard.mozilla.org/r/108240/#review109894
::: dom/bindings/Codegen.py:10230
(Diff revision 1)
> bodyInHeader=True,
> visibility="public",
> explicit=True,
> body="*this = aOther;\n"))
> + op_body=CGSwitch("aOther.mType", assignmentCases);
> + op_body.append(CGGeneric("return *this;\n"));
This seems wrong, CGSwitch being a list is an implementation detail. Please create your own CGList containing the CGSwitch and the CGGeneric.
Attachment #8831684 -
Flags: review?(peterv) → review-
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8831684 [details]
Bug 1335000 - return type& for copy assignment operator.
https://reviewboard.mozilla.org/r/108240/#review113402
Attachment #8831684 -
Flags: review?(peterv) → review+
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65b1e4b706e2
return type& for copy assignment operator. r=peterv
Comment 6•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•