Closed
Bug 1361647
Opened 7 years ago
Closed 7 years ago
Coverity report: nsMathMLmtableFrame::nsMathMLmtableFrame(nsStyleContext *): A scalar field is not initialized by the constructor
Categories
(Core :: MathML, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox53 | --- | wontfix |
firefox54 | --- | wontfix |
firefox55 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: fredw)
References
(Blocks 1 open bug, )
Details
(Keywords: coverity, good-first-bug, regression, Whiteboard: [lang=C++][CID 1225549])
Attachments
(1 file)
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
Coverity CID 1225549 Uninitialized scalar field The field will contain an arbitrary value left over from earlier computations. In nsMathMLmtableFrame::nsMathMLmtableFrame(nsStyleContext *): A scalar field is not initialized by the constructor 159protected: 160 explicit nsMathMLmtableFrame(nsStyleContext* aContext) 161 : nsTableFrame(aContext) 2. uninit_member: Non-static class member mFrameSpacingX is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member mFrameSpacingY is not initialized in this constructor nor in any functions that it calls. CID 1225549 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)6. uninit_member: Non-static class member mUseCSSSpacing is not initialized in this constructor nor in any functions that it calls. 162 {}
Updated•7 years ago
|
Blocks: coverity-analysis
Whiteboard: [lang=C++] → [lang=C++][CID 1225549]
Assignee | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment on attachment 8865109 [details] [diff] [review] Patch I have always preferred to initialize variables only once when that is practical. In the constructor here, no attempt is made to set these to the correct values and so they need to be set again later. They are not used before set correctly, but setting incorrect values before the correct values are calculated can hide from tools such as valgrind a failure to set correct values. Perhaps it is possible to call MapAllAttributesIntoCSS() from the constructor. I don't know, but I also don't know why it is important to do so. Perhaps Mats knows why Coverity thinks these should be set in the constructor.
Attachment #8865109 -
Flags: review?(karlt) → review?(mats)
Reporter | ||
Comment 3•7 years ago
|
||
> Perhaps Mats knows why Coverity thinks these should be set in the constructor.
Because it's a footgun to have uninitialized members laying around.
Reporter | ||
Comment 4•7 years ago
|
||
Comment on attachment 8865109 [details] [diff] [review] Patch LGTM, thanks!
Attachment #8865109 -
Flags: review?(mats) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/84a52fd86062 Coverity report: nsMathMLmtableFrame::nsMathMLmtableFrame(nsStyleContext *): A scalar field is not initialized by the constructor. r=karlt
Keywords: checkin-needed
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/84a52fd86062
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•7 years ago
|
status-firefox53:
--- → wontfix
status-firefox54:
--- → wontfix
status-firefox-esr52:
--- → unaffected
You need to log in
before you can comment on or make changes to this bug.
Description
•