Closed Bug 133711 Opened 23 years ago Closed 22 years ago

Unreachable statement (duplicate return) in nsXULAttribute and nsSVGAttributes (Bugs found via linting....)

Categories

(Core :: XUL, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.1beta

People

(Reporter: cyent, Assigned: timwatt)

References

()

Details

Attachments

(2 files, 1 obsolete file)

This is a list of bugs found by antic (http://artho.com/jlint/) The vast majority of false positives have been removed leaving only definite bugs and highly suspicious cases. ====================================================================== Same one as in svg The "return NS_OK" is unreachable, probably a bug. ~/builds/mozilla/content/xul/content/src/nsXULAttributes.cpp:600:9: Unreachable statement nsXULAttributes::RemoveNamedItem(const nsAReadableString& aName, nsIDOMNode** aReturn) { nsCOMPtr<nsIDOMElement> element( do_QueryInterface(mContent) ); if (element) { return element->RemoveAttribute(aName); *aReturn = nsnull; // XXX should be the element we just removed return NS_OK; } else { return NS_ERROR_FAILURE; } }
That would be "XP Toolkit/Widgets: XUL".
Assignee: asa → hyatt
Component: Browser-General → XP Toolkit/Widgets: XUL
QA Contact: doronr → shrir
cvsblame sez waterson. bbaetz, this was also copy-pasted into SVG: nsSVGAttributes.cpp, line 931.
Assignee: hyatt → waterson
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Which component is XUL? Bugs found via linting.... → Unreachable statement (duplicate return) in nsXULAttribute and nsSVGAttributes (Bugs found via linting....)
SVG case is bug 133710; feel free to fix both of these at the same time.
*** Bug 133710 has been marked as a duplicate of this bug. ***
How embarrassing. While we're at it, maybe we should remove the else-after-return, too?
Status: NEW → ASSIGNED
Keywords: patch
Priority: -- → P3
Target Milestone: --- → mozilla1.0.1
Target Milestone: mozilla1.0.1 → mozilla1.1beta
Attachment #92147 - Flags: review+
Jul 11 15:43 Out with the old, in with the new.
Assignee: waterson → bzbarsky
Status: ASSIGNED → NEW
Comment on attachment 92147 [details] [diff] [review] The previous patch without the else-after-return This leaves aReturn un-initialized. Unacceptable (even if equivalent to the exisiting code).
Attachment #92147 - Flags: needs-work+
This is not mine; please mail me when you need review instead of assigning bugs to me. To patch author, to fix the patch. ;)
Assignee: bzbarsky → riceman+bmo
I also pre-emptively fixed the grammar of the comment, just to avoid another round =)
Attachment #92147 - Attachment is obsolete: true
Comment on attachment 92193 [details] [diff] [review] Initialize out param, too sr=bzbarsky; please file bugs on fixing those aReturn values if there aren't such bugs already.
Attachment #92193 - Flags: superreview+
Attachment #92193 - Flags: review+
Blocks: 158627
This has had R+SR for a while. Has it bitrotted yet? I don't have a tree handy (or the capacity for a tree on this machine). I can check its status in a week or so. If it hasn't bitrotted (miraculously), is there something holding it from being checked in?
This has not bitrotted, and even builds. I'll try to check it in early next week, but if someone has time before then that would be great.
03/04/2003 18:35 timeless%mozdev.org mozilla/ content/ xul/ content/ src/ nsXULAttributes.cpp 1.62 3/5 Bug 133711 Unreachable statement (duplicate return) in nsXULAttribute and nsSVGAttributes (Bugs found via linting....) patch by riceman+bmo@mail.rit.edu r=timeless sr=bz therefore, marking FIXED.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: