Closed Bug 756087 Opened 12 years ago Closed 12 years ago

nsAccessible::GetChildCount should return unsigned int

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
      No description provided.
Attachment #624733 - Flags: review?(trev.saunders)
bumping it in Trevor's queue (sorry for the spam)
Comment on attachment 624733 [details] [diff] [review]
patch

>-  PRInt32 siblingCount = parent->GetChildCount();
>-  if (siblingCount < indexInParent) {
>+  PRUint32 siblingCount = parent->ChildCount();
>+  if (indexInParent == -1 ||
>+      indexInParent >= static_cast<PRInt32>(siblingCount)) {

wouldn't indexInParent < 0 be safer?
Attachment #624733 - Flags: review?(trev.saunders) → review+
(In reply to Trevor Saunders (:tbsaunde) from comment #2)

> wouldn't indexInParent < 0 be safer?

yes like null checking the every pointer but that means there's something pretty wrong, I wouldn't hide errors.
https://hg.mozilla.org/mozilla-central/rev/8da4ff25a24a
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.