Last Comment Bug 701274 - JSD's jsd_ThrowHandler uses value from wrong enumeration
: JSD's jsd_ThrowHandler uses value from wrong enumeration
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla11
Assigned To: Jim Blandy :jimb
:
Mentors:
Depends on:
Blocks: 687683
  Show dependency treegraph
 
Reported: 2011-11-09 19:34 PST by Jim Blandy :jimb
Modified: 2012-02-01 13:57 PST (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Make jsd_ThrowHandler return the proper JSTrapStatus value, not JSD_HOOK_RETURN_CONTINUE_THROW. (1.14 KB, patch)
2011-11-11 22:27 PST, Jim Blandy :jimb
sphink: review+
Details | Diff | Review

Description Jim Blandy :jimb 2011-11-09 19:34:42 PST
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.
Comment 1 Jim Blandy :jimb 2011-11-09 19:35:06 PST
(Simple patch forthcoming...)
Comment 2 Jim Blandy :jimb 2011-11-11 22:27:10 PST
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
Comment 3 Jim Blandy :jimb 2011-11-12 09:37:02 PST
Try server liked it, so here you go.
Comment 5 Ed Morley [:emorley] 2011-11-15 11:45:32 PST
https://hg.mozilla.org/mozilla-central/rev/26e489b81e7f

Note You need to log in before you can comment on or make changes to this bug.