Closed Bug 275116 Opened 20 years ago Closed 18 years ago

nsIArray.idl claims that an exception is thrown on out of range index, instead a fatal assertion occurs

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: vlad, Assigned: anlan)

Details

Attachments

(1 file)

If you try to call queryElementAt on an out of range index, nsIArray.idl claims
that you'll get NS_ERROR_ILLEGAL_VALUE.  Instead, you get:

poke###!!! ASSERTION: index out of range: '0 <= aIndex && aIndex < Count()',
file ../../../mozilla/xpcom/ds/nsVoidArray.h, line 71
Break: at file ../../../mozilla/xpcom/ds/nsVoidArray.h, line 71
Summary: nsIArray.idl claims that an exception is thrown on out of index, instead a fatal assertion occurs → nsIArray.idl claims that an exception is thrown on out of range index, instead a fatal assertion occurs
Yeah, this should use SafeObjectAt() (and the right error return too).
Whiteboard: [good first bug]
This seems to follow bz's comment.
Attachment #176990 - Flags: review?(dougt)
Comment on attachment 176990 [details] [diff] [review]
SafeObjectAt, changed error

Six months since review request, trying different reviewer.

Simple correctness patch.
Attachment #176990 - Flags: review?(dougt) → review?(alecf)
I don't know that alecf is active anymore. You might try emailing dougt directly, or requesting review from darin fisher (darin at meer dot net)
QA Contact: xpcom
Attachment #176990 - Flags: review?(alecf) → review?(darin.moz)
Status: NEW → ASSIGNED
Attachment #176990 - Flags: review?(darin.moz) → review+
Comment on attachment 176990 [details] [diff] [review]
SafeObjectAt, changed error

sr=biesi
Attachment #176990 - Flags: superreview+
Whiteboard: [good first bug]
Assignee: dougt → mozilla
Status: ASSIGNED → NEW
Checking in nsArray.cpp;
/cvsroot/mozilla/xpcom/ds/nsArray.cpp,v  <--  nsArray.cpp
new revision: 1.13; previous revision: 1.12
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: