Deadcode in nsWindow::SetParent for aNewParent = 0

VERIFIED FIXED in mozilla7

Status

Core Graveyard
Widget: Qt
VERIFIED FIXED
7 years ago
10 months ago

People

(Reporter: timeless, Assigned: emorley)

Tracking

({coverity})

Trunk
mozilla7
coverity
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
386 nsWindow::SetParent(nsIWidget *aNewParent)
387 {
388     NS_ENSURE_ARG_POINTER(aNewParent);

after this statement, aNewParent can't be null,

which means this statement is always true (and a waste of a comparison):
389     if (aNewParent) {

and all code flows through here:
390         nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
...
and all code exits here:
405         return NS_OK;

which means none of the code from here:
406     }

to here is reachable:
418     return NS_OK;

Comment 1

6 years ago
Valid points raised in this issue.

I am no longer involved with that code, so I reassigned the issue to the default person.
Assignee: tobias.hunger → nobody
(Assignee)

Updated

6 years ago
Assignee: nobody → bmo
Status: NEW → ASSIGNED
(Assignee)

Comment 2

6 years ago
Created attachment 536112 [details] [diff] [review]
Remove dead code in nsWindow::SetParent

The code has since been partially rewritten by bug 449734 since comment 0, but some deadcode still remains.
Attachment #536112 - Flags: review?(romaxa)
Attachment #536112 - Flags: review?(romaxa) → review+
Keywords: checkin-needed
http://hg.mozilla.org/projects/cedar/rev/1b64d176d7ad
Keywords: checkin-needed
Whiteboard: [fixed-in-cedar]
Pushed:
http://hg.mozilla.org/mozilla-central/rev/1b64d176d7ad
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite-
OS: Linux → All
Hardware: x86 → All
Resolution: --- → FIXED
Whiteboard: [fixed-in-cedar]
Target Milestone: --- → mozilla7

Comment 5

6 years ago
Setting resolution to Verified Fixed on Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0 beta 3
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.