If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Variables used before they are set in nsJSXUL*

VERIFIED WORKSFORME

Status

()

Core
Security
P3
normal
VERIFIED WORKSFORME
18 years ago
18 years ago

People

(Reporter: jim_nance, Assigned: Norris Boyd)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
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.
(Reporter)

Comment 1

18 years ago
Created attachment 6673 [details] [diff] [review]
Patch to fix bugs

Comment 2

18 years ago
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*
(Assignee)

Comment 3

18 years ago
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
(Assignee)

Comment 4

18 years ago
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
Last Resolved: 18 years ago
Resolution: --- → WORKSFORME

Comment 5

18 years ago
Verified per norris' comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.