Closed Bug 701274 Opened 8 years ago Closed 8 years ago

JSD's jsd_ThrowHandler uses value from wrong enumeration

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: jimb, Assigned: jimb)

References

Details

(Whiteboard: [inbound])

Attachments

(1 file)

Although jsd_ThrowHandler is declared to return a JSTrapStatus --- as expected for functions used for JSDebugHooks::throwHook --- the code may actually return JSD_HOOK_RETURN_CONTINUE_THROW, which is not a valid JSTrapStatus value.

This turns out to not have any effect: the js/src code that calls throwHook happens to treat bogus JSTrapStatus values as equivalent to JSTRAP_CONTINUE, which is what jsd_ThrowHandler should be returning. And when there is a JSDContext::throwHook established, jsd_ThrowHandler passes through the return value of jsd_CallExecutionHook, which uses JSTrapStatus properly.

But I would like to tighten up js/src to check that hooks return valid JSTrapStatus values, so I would like to fix jsd_ThrowHandler.
(Simple patch forthcoming...)
Blocks: 687683
Attachment #574006 - Flags: review?(sphink)
Try server liked it, so here you go.
Attachment #574006 - Flags: review?(sphink) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/26e489b81e7f
Status: NEW → ASSIGNED
Whiteboard: [inbound]
https://hg.mozilla.org/mozilla-central/rev/26e489b81e7f
Assignee: general → jimb
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.