The default bug view has changed. See this FAQ.

JSD's jsd_ThrowHandler uses value from wrong enumeration

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

unspecified
mozilla11
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
(Simple patch forthcoming...)
(Assignee)

Comment 2

5 years ago
Created attachment 574006 [details] [diff] [review]
Make jsd_ThrowHandler return the proper JSTrapStatus value, not JSD_HOOK_RETURN_CONTINUE_THROW.

The try server is evaluating this patch, along with the patches for bug 687683 and bug 700070, here:
https://tbpl.mozilla.org/?tree=Try&rev=ec00649f1af6
(Assignee)

Updated

5 years ago
Blocks: 687683
(Assignee)

Updated

5 years ago
Attachment #574006 - Flags: review?(sphink)
(Assignee)

Comment 3

5 years ago
Try server liked it, so here you go.
Attachment #574006 - Flags: review?(sphink) → review+
(Assignee)

Comment 4

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.