Closed Bug 1144625 Opened 9 years ago Closed 2 years ago

Useless initialization of rect in nsRegion::SimplifyOutwardByArea

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: bogato, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: clang-analyzer, Whiteboard: [lang=c++][gfx-noted])

Attachments

(1 file, 1 obsolete file)

Attached patch patch.diff (obsolete) — Splinter Review
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150306140254

Steps to reproduce:

In nsRegion::SimplifyOutwardByArea (line 315), the value stored is never read.
Moreover, it is used only on the first if statement (line 335).
Mentor: jmuizelaar
Severity: normal → trivial
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [lang=c++]
Attachment #8579310 - Flags: review?(jmuizelaar)
Keywords: checkin-needed
checkin-needed is used to signify patches that are ready to land, which comes after they've gone through review :)

Also, please see the link below and be sure to generate a patch that contains the needed commit information for landing:
https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F

Thanks for the patch!
Assignee: nobody → bogato
Component: Untriaged → Graphics
Keywords: checkin-needed
Product: Firefox → Core
Comment on attachment 8579310 [details] [diff] [review]
patch.diff

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

How did you find this? Was it with an automated tool?

::: gfx/src/nsRegion.cpp
@@ +311,4 @@
>    tmpStorage.SetCapacity(n);
>    pixman_box32_t *tmpRect = tmpStorage.Elements();
>  
> +  pixman_box32_t *destRect = boxes; 

There's a bit of added white space here. Please remove it.
Attachment #8579310 - Flags: review?(jmuizelaar) → review+
Attached patch patch.diffSplinter Review
Hi !
I found this with an automated tool.
I removed the space and followed the instructions to generate this patch !
Attachment #8579310 - Attachment is obsolete: true
Attachment #8580247 - Flags: review?(jmuizelaar)
(In reply to Quentin BOUILLAGUET from comment #3)
> Created attachment 8580247 [details] [diff] [review]
> patch.diff
> 
> Hi !
> I found this with an automated tool.
> I removed the space and followed the instructions to generate this patch !

What was the tool?
(In reply to Jeff Muizelaar [:jrmuizel] from comment #4)
> (In reply to Quentin BOUILLAGUET from comment #3)
> > Created attachment 8580247 [details] [diff] [review]
> > patch.diff
> > 
> > Hi !
> > I found this with an automated tool.
> > I removed the space and followed the instructions to generate this patch !
> 
> What was the tool?


I'm currently a student.
Our professor gave us a list of some easy fixes to learn how to contribute to mozilla.
So... I don't know wich tools he used.
I'd be very interested in knowing what tool it was.
Attachment #8580247 - Flags: review?(jmuizelaar) → review+
(In reply to Quentin BOUILLAGUET from comment #5)
> (In reply to Jeff Muizelaar [:jrmuizel] from comment #4)
> > (In reply to Quentin BOUILLAGUET from comment #3)
> > > Created attachment 8580247 [details] [diff] [review]
> > > patch.diff
> > > 
> > > Hi !
> > > I found this with an automated tool.
> > > I removed the space and followed the instructions to generate this patch !
> > 
> > What was the tool?

Hello !
The automated tool we used was scan-build from clang.
> 
> 
> I'm currently a student.
> Our professor gave us a list of some easy fixes to learn how to contribute
> to mozilla.
> So... I don't know wich tools he used.
Jeff, I did a presentation at this university . Their teacher is a good friend and I gave him some material.
Drop me an email if you want to get access to it.
Jeff, is this bug still relevant?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jmuizelaar)
Whiteboard: [lang=c++] → [lang=c++][gfx-noted]

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: bogato → nobody

This code has since been rewritten

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jmuizelaar)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: