bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Fix -Wsometimes-uninitialized nsresult warnings in editor/libeditor

RESOLVED DUPLICATE of bug 1093245

Status

()

Core
Editor
RESOLVED DUPLICATE of bug 1093245
4 years ago
4 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

(Blocks: 1 bug, {regression})

unspecified
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox35 unaffected, firefox36 affected)

Details

Attachments

(1 obsolete attachment)

(Assignee)

Description

4 years ago
Created attachment 8515760 [details] [diff] [review]
Wsometimes-uninitialized_nsresult.patch

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)

Comment 1

4 years ago
I already r+ed a simpler fix in bug 1093245.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1093245

Updated

4 years ago
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.