Closed
Bug 557690
Opened 15 years ago
Closed 15 years ago
nsEditor.cpp:2037: error: ‘result’ may be used uninitialized in this function
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: craig.topper)
References
Details
Attachments
(1 file)
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
This changeset from bug 253889...
http://hg.mozilla.org/mozilla-central/rev/c9f647e9d472
... removed the only line that set the return value |result| in nsEditor::QueryComposition, leaving that method with an uninitialized return value.
This is noted by this warning in opt builds:
{
> editor/libeditor/base/nsEditor.cpp:2037: error: ‘result’ may be used uninitialized in this function
> editor/libeditor/base/nsEditor.cpp:1975: note: ‘result’ was declared here
}
Link to code as it currently stands:
http://hg.mozilla.org/mozilla-central/annotate/64ebf70ed4a2/editor/libeditor/base/nsEditor.cpp#l1972
There are now only two mentions of the variable |result| in that method -- the declaration (which doesn't initialize it), and the return statement (where we return who-knows-what).
Craig, do you think you could investigate, since this was from your patch? It might be that nsEditor::QueryComposition doesn't even need a return-value anymore, or maybe it can just return a PRBool or something simpler now -- I'm not sure.
Assignee | ||
Comment 1•15 years ago
|
||
Looks like it still returns NS_ERROR_NOT_INITIALIZED in two places. Probaby just need to remove the result and change to return NS_OK at the end.
Assignee | ||
Comment 2•15 years ago
|
||
Assignee | ||
Updated•15 years ago
|
Attachment #437476 -
Flags: review?(roc)
Attachment #437476 -
Flags: review?(roc) → review+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 3•15 years ago
|
||
Thanks for the quick fix! Landed:
http://hg.mozilla.org/mozilla-central/rev/076041952721
Assignee: nobody → craig.topper
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•