Closed Bug 1157664 Opened 5 years ago Closed 5 years ago

Uninitialized member mozilla::layers::FPSCounter::mIteratorIndex in constructor

Categories

(Core :: Graphics: Layers, defect, trivial)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: nical, Assigned: mathieu.blot, Mentored)

Details

Attachments

(1 file, 1 obsolete file)

This is benign but adds to the coverity warning noise, so let's fix it.
Keywords: coverity
Hello, I would like to work on that bug, please.
Assignee: nobody → mathieu.blot
Do FPSCounter::mIteratorIndex need to be initialized to a specific value ?
Flags: needinfo?(nical.bugzilla)
(In reply to mathieu.blot from comment #2)
> Do FPSCounter::mIteratorIndex need to be initialized to a specific value ?

-1 will do. It's an invalid value so it will trigger assertions if we ever forget to initialize mIteratorIndex when starting to iterate.
Flags: needinfo?(nical.bugzilla)
Attached patch Build successful (obsolete) — Splinter Review
Attachment #8607571 - Flags: review?(nical.bugzilla)
Comment on attachment 8607571 [details] [diff] [review]
Build successful

Review of attachment 8607571 [details] [diff] [review]:
-----------------------------------------------------------------

Move that up one line and you'll have the r+ :)

::: gfx/layers/composite/FPSCounter.cpp
@@ +29,5 @@
>  
>  FPSCounter::FPSCounter(const char* aName)
>    : mWriteIndex(0)
>    , mFPSName(aName)
> +  , mIteratorIndex(-1)

Please initialize members in the same order they are declared (mIterator comes before mFPSName).
Attachment #8607571 - Flags: review?(nical.bugzilla) → review-
Attached patch Build successfulSplinter Review
Initializations in the same order as the definition of the members.
Attachment #8607571 - Attachment is obsolete: true
Attachment #8607637 - Flags: review?(nical.bugzilla)
Attachment #8607637 - Flags: review?(nical.bugzilla) → review+
can we get a try run for this ?
Flags: needinfo?(mathieu.blot)
Keywords: checkin-needed
Flags: needinfo?(mathieu.blot)
Keywords: coveritycheckin-needed
https://hg.mozilla.org/mozilla-central/rev/8964d03d9599
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.