Closed Bug 32370 Opened 24 years ago Closed 24 years ago

Variables used before they are set in nsJSXUL*

Categories

(Core :: Security, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: jim_nance, Assigned: norrisboyd)

Details

Attachments

(1 file)

My compiler discovered several places in the code where variables
were being used before they were set.  I took a look at the code
and the compiler was right.  These look like real bugs.  I have
attached a patch that fixes these problems.
CVS log says all these belong to norris.
Assignee: cbegle → norris
Component: Browser-General → Security: General
QA Contact: asadotzler → junruh
Summary: Variables used before they are set → Variables used before they are set in nsJSXUL*
The change in nsHTMLSelectElement.cpp appears already to have been made.

All the nsJSXUL* files are generated by the DOM idl compiler. I tweaked that
recently; thanks for catching the problems. I'll fix it by redoing the compiler.
Status: NEW → ASSIGNED
Target Milestone: M15
actually, when I look at the latest version on the tip, all the declarations of
nsresult rv are now initialized to NS_OK. So there shouldn't be any reads of
uninitialized variables.

I don't think I'll try to actually remove the declarations and usages of rv from
the places you indicate. It's hard to detect those situations in the stub
generator (see mozilla/dom/tools/JSStubGen.cpp), and a halfway decent optimizing
compiler should do constant propagation and dead code elimination to produce the
same effect.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Verified per norris' comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: