Closed Bug 1361656 Opened 7 years ago Closed 7 years ago

Coverity report: nsGridContainerFrame::​nsGridContainerFrame(nsStyleContext *): A scalar field is not initialized by the constructor

Categories

(Core :: Layout, defect)

53 Branch
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox-esr52 --- unaffected
firefox53 --- wontfix
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: emilio)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, good-first-bug, regression, Whiteboard: [lang=C++][CID 1291009])

Coverity CID 1291009 Uninitialized scalar field

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

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



260  explicit nsGridContainerFrame(nsStyleContext* aContext)
261    : nsContainerFrame(aContext, mozilla::LayoutFrameType::GridContainer)
262    , mCachedMinISize(NS_INTRINSIC_WIDTH_UNKNOWN)
263    , mCachedPrefISize(NS_INTRINSIC_WIDTH_UNKNOWN)
264  {
265    mBaseline[0][0] = NS_INTRINSIC_WIDTH_UNKNOWN;
266    mBaseline[0][1] = NS_INTRINSIC_WIDTH_UNKNOWN;
267    mBaseline[1][0] = NS_INTRINSIC_WIDTH_UNKNOWN;
268    mBaseline[1][1] = NS_INTRINSIC_WIDTH_UNKNOWN;
   CID 1291009 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)2. uninit_member: Non-static class member mDidPushItemsBitMayLie is not initialized in this constructor nor in any functions that it calls.
269  }


mDidPushItemsBitMayLie is #ifdef DEBUG and nothing bad happens if it has
the wrong value - just a false positive assert in the worst case.
Still, we should init it to zero in the ctor to avoid that.
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eb9858f09ee5
Initialize nsGridContainerFrame::mDidPushItemsBitMayLie. r=mats
https://hg.mozilla.org/mozilla-central/rev/eb9858f09ee5
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee: nobody → emilio+bugs
Whiteboard: [lang=C++] → [lang=C++][CID 1291009]
You need to log in before you can comment on or make changes to this bug.