use early returns in nsObjectLoadingContent::IsSupportedDocument

RESOLVED FIXED in mozilla17

Status

()

Core
Plug-ins
--
enhancement
RESOLVED FIXED
11 years ago
5 years ago

People

(Reporter: timeless, Assigned: johns)

Tracking

Trunk
mozilla17
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

11 years ago
coverity doesn't like this code, but it's wrong in claiming that it's dangerous.

i don't like this code either, so this bug is a request for:

if (!info)
  return PR_FALSE;

it simplifies the code and happens to quiet coverity (which complains that supported is used uninitialized - in the impossible case of do_GetService setting info to null and rv to ns_ok).
(Reporter)

Comment 1

11 years ago
Created attachment 218659 [details] [diff] [review]
use early returns
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #218659 - Flags: superreview?(bzbarsky)
Attachment #218659 - Flags: review?(cbiesinger)

Comment 2

11 years ago
Comment on attachment 218659 [details] [diff] [review]
use early returns

Single-line ifs should be braced in this code.

Also, I'd like to see both the -w diff and a normal one.
Attachment #218659 - Flags: superreview?(bzbarsky) → superreview-
Comment on attachment 218659 [details] [diff] [review]
use early returns

what bz said
Attachment #218659 - Flags: review?(cbiesinger)
(Assignee)

Updated

5 years ago
Depends on: 745030
(Assignee)

Comment 4

5 years ago
Created attachment 650304 [details] [diff] [review]
Use early returns in nsObjectLoadingContent::IsSupportedDocument
(Assignee)

Comment 5

5 years ago
Comment on attachment 650304 [details] [diff] [review]
Use early returns in nsObjectLoadingContent::IsSupportedDocument

Resurrecting from the grave!
Attachment #650304 - Flags: review?(bzbarsky)
(Assignee)

Updated

5 years ago
Assignee: timeless → jschoenick
OS: Mac OS X → All
Hardware: PowerPC → All
(Assignee)

Updated

5 years ago
Attachment #218659 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
Created attachment 650344 [details] [diff] [review]
Use early returns in nsObjectLoadingContent::IsSupportedDocument

Maybe a version that compiles would be preferable
Attachment #650304 - Attachment is obsolete: true
Attachment #650304 - Flags: review?(bzbarsky)
Attachment #650344 - Flags: review?(bzbarsky)

Comment 7

5 years ago
Comment on attachment 650344 [details] [diff] [review]
Use early returns in nsObjectLoadingContent::IsSupportedDocument

r=me
Attachment #650344 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 8

5 years ago
Survived a try push here:
https://tbpl.mozilla.org/?tree=Try&rev=02f602af452c

Landed on m-i:
http://hg.mozilla.org/integration/mozilla-inbound/rev/08631f0a9b1d
https://hg.mozilla.org/mozilla-central/rev/08631f0a9b1d
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.