Closed Bug 329877 Opened 18 years ago Closed 18 years ago

Coverity complains that js_ErrorToException dereferences reportp before null checking

Categories

(Core :: JavaScript Engine, defect)

PowerPC
macOS
defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file, 1 obsolete file)

there's already a JS_ASSERT in js_ErrorToException, so I'd at least like to remove the useless unreachable case at the bottom of js_ErrorToException.

There's only one uncontrolled caller, JS_ThrowReportedError. I'd kinda like to stick a JS_ASSERT into it.

I'm perfectly happy w/ this bug being squished, but I'll attach the two independent patches anyway.
Assignee: general → timeless
Status: UNCONFIRMED → ASSIGNED
Attachment #214528 - Flags: review?(brendan)
Attachment #214529 - Flags: review?(brendan)
Comment on attachment 214529 [details] [diff] [review]
JS_ASSERT at api entrypoint

We don't generally assert non-null, since a null ptr deref crash says enough.  Anyway, js_E2E does the very same thing, so this is purely redundant.

/be
Attachment #214529 - Flags: review?(brendan) → review-
Comment on attachment 214528 [details] [diff] [review]
don't bother null checking something that can't be null

Thanks, this is good.

/be
Attachment #214528 - Flags: review?(brendan) → review+
Comment on attachment 214528 [details] [diff] [review]
don't bother null checking something that can't be null

mozilla/js/src/jsexn.c 	3.58
Attachment #214528 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: