Closed Bug 563303 Opened 15 years ago Closed 15 years ago

useless check of !data.index in nsContentUtils::ReparentClonedObjectToScope

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [build_warning])

Attachments

(1 file, 1 obsolete file)

(deleted), patch
timeless
: review+
Details | Diff | Splinter Review
5822 nsContentUtils::ReparentClonedObjectToScope(JSContext* cx, 5833 while (!objectData.IsEmpty()) { 5836 if (!data.ids && !data.index) { 5874 } 5878 if (data.index == data.ids->length) {
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
you're assuming data.index == 0, what if data.index isn't 0?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
data.index is initialized to 0 and it's only ever set to a nonzero value if data.ids is nonzero. Since it's impossible to have a null data.ids without failing I don't see any bug here. Please correct me or close this bug as appropriate.
Assignee: nobody → timeless
Severity: critical → trivial
Status: REOPENED → ASSIGNED
Keywords: crash
Summary: crash [@ nsContentUtils::ReparentClonedObjectToScope] if !data.ids → useless check of !data.index in nsContentUtils::ReparentClonedObjectToScope
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #443371 - Flags: review?(bent.mozilla)
Comment on attachment 443371 [details] [diff] [review] patch >- if (!data.ids && !data.index) { >+ if (!data.ids) { Can you add NS_ASSERTION(!data.index, "Shouldn't have index here") right here? r=me with that.
Attachment #443371 - Flags: review?(bent.mozilla) → review+
Attached patch patch (deleted) — Splinter Review
Attachment #443371 - Attachment is obsolete: true
Attachment #443459 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 15 years ago15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [build_warning]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: