Closed Bug 1092923 Opened 5 years ago Closed 5 years ago

Fix -Wsometimes-uninitialized nsresult warnings in editor/libeditor

Categories

(Core :: Editor, defect)

defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1093245
Tracking Status
firefox35 --- unaffected
firefox36 --- affected

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 obsolete file)

Bug 1088054 removed some editor code paths, leaving some nsresults uninitialized:

> editor/libeditor/nsHTMLEditRules.cpp:4952:7 [-Wsometimes-uninitialized] variable 'res' is used uninitialized whenever 'if' condition is true
> editor/libeditor/nsHTMLEditorStyle.cpp:1120:7 [-Wsometimes-uninitialized] variable 'result' is used uninitialized whenever 'if' condition is false

In nsHTMLEditRules.cpp, I moved the GetFirstEditableChild() check earlier in the function so, if firstChild is null, we can return without calling GetLastEditableChild().
Attachment #8515760 - Flags: review?(ehsan.akhgari)
I already r+ed a simpler fix in bug 1093245.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1093245
Attachment #8515760 - Attachment is obsolete: true
Attachment #8515760 - Flags: review?(ehsan.akhgari)
You need to log in before you can comment on or make changes to this bug.