Closed Bug 293739 Opened 19 years ago Closed 12 years ago

PRBool success might be used uninitialized ... (nsBulletFrame line 1114)

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 534171

People

(Reporter: bfowler, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050418 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050418 Firefox/1.0.3

At and below  
http://lxr.mozilla.org/mozilla/source/layout/generic/nsBulletFrame.cpp#1114
if any of the first four switch branches are taken, then indeed 'success'
might be used without being assigned to.

Maybe this can't happen.

There may be more than one way of fixing this warning - would anyone like a 
patch?

Reproducible: Always
Summary: PRBool success might be used uninitalized ... (line 1114) → PRBool success might be used uninitalized ... (nsBulletFrame line 1114)
Confirming, if you are willing to make a patch please do.

I would suggest pre-setting success to PR_True rather than mucking with those
first 4 case's.  Though if you have another idea, go for it. [Please note I am
not a reviewer]
Status: UNCONFIRMED → NEW
Ever confirmed: true
Add initalisation of sucess to PR_TRUE, and some comments. PR_TRUE
(requested conversion succeeded) is the default condition, PR_FALSE
implies that some fall-back operation took place.
Attachment #183580 - Flags: review?
I would suggest requesting review from a particular person, (preferrably one
with a shorter review que)

Use
http://www.mozilla.org/owners.html  if you are unsure.
Thank you. It might be David Baron, but I don't know enough about requesting 
review and review queues to jump in!
generally documentation for functions is put in the header file...
Comment on attachment 183580 [details] [diff] [review]
Patch to fix compiler warning, by ensuring that success is always initialised

Targetting review and adding sr? since this should be a simple fix; Though I am
with biesi on that the documentation section should be in the class
declaration, not in its implimentation.
Attachment #183580 - Flags: superreview?(dbaron)
Attachment #183580 - Flags: review?(dbaron)
Attachment #183580 - Flags: review?
Comment on attachment 183580 [details] [diff] [review]
Patch to fix compiler warning, by ensuring that success is always initialised

The massive comment at the beginning of AppendCounterText is way too verbose,
and probably belongs in the header file anyway.  Other than the @param lines,
most of it is either unnecessary or incorrect.

The comment about retrying is also incorrect.  It's not clear why the boolean
return exists at all, but it's not for retrying, since the function can return
false even when it does append text to the string.
Attachment #183580 - Flags: superreview?(dbaron)
Attachment #183580 - Flags: superreview-
Attachment #183580 - Flags: review?(dbaron)
Attachment #183580 - Flags: review-
Attached patch Improved patch (obsolete) — Splinter Review
Shortened comment and removed comment, as above
Attachment #183580 - Attachment is obsolete: true
Attachment #183893 - Flags: review?
Ben, you want to request review from a specific person (see
http://www.mozilla.org/owners.html for the relevant module owners), not review
in general...
Comment on attachment 183893 [details] [diff] [review]
Improved patch

Requesting review from dbaron. Sorry for the hold-up
Attachment #183893 - Flags: review? → review?(dbaron)
Summary: PRBool success might be used uninitalized ... (nsBulletFrame line 1114) → PRBool success might be used uninitialized ... (nsBulletFrame line 1114)
Comment on attachment 183893 [details] [diff] [review]
Improved patch

+ * @param result The nsString to be appended to
+  **/

wrong indentation on this second line, and is there a reason you did not put
the comment in the header file?
Attached patch Removed commentSplinter Review
White space change was probably an editing error. I have removed the
comment altogether - it is obviously out of place
Attachment #183893 - Attachment is obsolete: true
Attachment #186843 - Flags: review?
Attachment #186843 - Flags: review? → review?(dbaron)
This patch got review but got never checked in.
Do we need an updated patch or is this now obsolete since the PRBool-> Bool switch ?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: