Closed Bug 1361617 Opened 3 years ago Closed 3 years ago

Coverity report: ​nsFlexContainerFrame::mChildrenHaveBeenReordered is not initialized in this constructor nor in any functions that it calls

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mats, Assigned: dholbert)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

Coverity CID 1221327 Uninitialized scalar field

The field will contain an arbitrary value left over from earlier computations.

In nsFlexContainerFrame::​nsFlexContainerFrame(nsStyleContext *): A scalar field is not initialized by the constructor

135  explicit nsFlexContainerFrame(nsStyleContext* aContext)
136    : nsContainerFrame(aContext, mozilla::FrameType::FlexContainer)
137    , mBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
138    , mLastBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
   CID 1221327 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)2. uninit_member: Non-static class member mChildrenHaveBeenReordered is not initialized in this constructor nor in any functions that it calls.
139  {}


===============================

AFAICT, nsFlexContainerFrame::mChildrenHaveBeenReordered is unused and can be removed:
http://searchfox.org/mozilla-central/search?q=mChildrenHaveBeenReordered&case=false&regexp=false&path=
Duplicate of this bug: 1361613
Duplicate of this bug: 1361614
Duplicate of this bug: 1361615
Duplicate of this bug: 1361616
Yup -- looks like we removed the variable's usages in bug 981116, but didn't remove the variable itself.  Thanks for catching this!
Depends on: 981116
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
(oops; I didn't notice you'd tagged this as "good-first-bug" until after I pushed the patch. Ah well.)
Keywords: good-first-bug
Comment on attachment 8867056 [details]
Bug 1361617: Remove unused member var nsFlexContainerFrame::mChildrenHaveBeenReordered.

https://reviewboard.mozilla.org/r/138674/#review141936
Attachment #8867056 - Flags: review?(mats) → review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/25e130b9fb74
Remove unused member var nsFlexContainerFrame::mChildrenHaveBeenReordered. r=mats
https://hg.mozilla.org/mozilla-central/rev/25e130b9fb74
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.