Occurances of uninitialized variables being used before being set.

VERIFIED FIXED

Status

()

Core
Internationalization
P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Rich Burridge, Assigned: Shanjian Li)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

(Reporter)

Description

18 years ago
For more details on this problem, see:

http://bugzilla.mozilla.org/show_bug.cgi?id=59652

This bug is just for the warnings in various source files in the 
Internationization module:

nsUnicodeToISO2022JP.cpp:153: warning: `nsresult res' might be used
uninitialized in this function
----
nsCharDetModule.cpp:151: warning: `nsresult rv' might be used uninitialized in
this function
----
nsPSMDetectors.cpp:442: warning: `PRInt32 bestIdx' might be used uninitialized
in this function
----

Comment 1

18 years ago
Reassign to shanjian.
Assignee: nhotta → shanjian
(Reporter)

Updated

18 years ago
Blocks: 59652
(Assignee)

Comment 2

18 years ago
Created attachment 19061 [details] [diff] [review]
patch 1
(Assignee)

Comment 3

18 years ago
Created attachment 19062 [details] [diff] [review]
patch 2
(Assignee)

Comment 4

18 years ago
Created attachment 19063 [details] [diff] [review]
patch 3
(Assignee)

Comment 5

18 years ago
The first 2 places seems fine. The 3rd is very likely to cause crashes. Let me 
know when and where should I check in those fixes. (Please email me directly.)

frank, please review those changes.
Status: NEW → ASSIGNED
(Reporter)

Comment 6

18 years ago
It's too late to check in to the RTM branch, so I'm assuming
these changes will need to be checked into the Mozilla trunk.
We (Sun) will also be adding similar changes to our OEM source
code branch for our RTM/FCS release. Thanks for finding/fixing
these so quickly!

Comment 7

18 years ago
For the first patch, should it be initialized as NS_OK or an error?
Cata, do you have any idea?
(Assignee)

Comment 8

18 years ago
The only case that res will not be assigned before it is returned by is
Src >= SrcEnd, and that is the length equal to 0. Since there is nothing 
to do, we cann't say it's a failure.

Comment 9

18 years ago
Okay, r=nhotta for three patches (Frank is not available now), please get a
super review.

Comment 10

18 years ago
Patch 3 seems to have some indentation problems. Maybe you have tabs in there?
There should not be any tabs in Mozilla source. Please fix this, and re-submit
Patch 3. Then I will give sr=.
(Assignee)

Comment 11

18 years ago
Created attachment 19319 [details] [diff] [review]
new patch, part3
(Assignee)

Comment 12

18 years ago
Created attachment 19320 [details] [diff] [review]
new patch, part 2
(Assignee)

Comment 13

18 years ago
new patch remove tab to spaces. 

Comment 14

18 years ago
Shanjian, the Mozilla convention is to use 2 spaces to indent.

  http://www.mozilla.org/newlayout/doc/codingconventions.html

No need to attach new patches. sr=erik as long as you change it to 2 spaces
(Assignee)

Comment 15

18 years ago
fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Updated

18 years ago
Blocks: 60740
(Reporter)

Comment 16

18 years ago
Changes also checked into the OEM branch.

Comment 17

18 years ago
Changed QA contact to shanjian@netscape.com.  Shanjian, QA cannot verify this.  Please mark as verified.
QA Contact: teruko → shanjian
(Assignee)

Comment 18

18 years ago
mark it verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.