Bug 165055 - Fix exception scope verification failures in miscellaneous files.
Summary: Fix exception scope verification failures in miscellaneous files.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks: 162351
  Show dependency treegraph
 
Reported: 2016-11-23 22:27 PST by Mark Lam
Modified: 2016-11-28 14:22 PST (History)
8 users (show)

See Also:


Attachments
proposed patch. (11.93 KB, patch)
2016-11-23 22:30 PST, Mark Lam
no flags Details | Formatted Diff | Diff
proposed patch. (11.93 KB, patch)
2016-11-23 22:33 PST, Mark Lam
mark.lam: review-
Details | Formatted Diff | Diff
proposed patch. (9.28 KB, patch)
2016-11-25 14:15 PST, Mark Lam
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2016-11-23 22:27:02 PST
Patch coming.
Comment 1 Mark Lam 2016-11-23 22:30:59 PST
Created attachment 295393 [details]
proposed patch.
Comment 2 Mark Lam 2016-11-23 22:33:10 PST
Created attachment 295394 [details]
proposed patch.
Comment 3 Mark Lam 2016-11-24 13:37:45 PST
Comment on attachment 295394 [details]
proposed patch.

It is invalid to replace returning encodedJSValue() with returning { }.  On 32-bit builds, the former is non-zero, while the latter is 0.  Will fix this patch.
Comment 4 Mark Lam 2016-11-25 14:15:05 PST
Created attachment 295430 [details]
proposed patch.
Comment 5 Saam Barati 2016-11-28 13:53:35 PST
Comment on attachment 295430 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=295430&action=review

> Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp:148
> +    if (!moduleRecord) {
> +        scope.release();

Why not just move the DECLARE_THROW_SCOPE lower?
Comment 6 Mark Lam 2016-11-28 14:19:00 PST
Comment on attachment 295430 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=295430&action=review

>> Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp:148
>> +        scope.release();
> 
> Why not just move the DECLARE_THROW_SCOPE lower?

Because the rule of thumb is to DECLARE_THROW_SCOPE (or DECLARE_CATCH_SCOPE) as high up in the function as much as possible.  Keeping it consistent this way removes the chance of missing needed exception checks because someone declared it too late, and a function call that can throw is added subsequently before the declaration of the throw scope.
Comment 7 Mark Lam 2016-11-28 14:22:26 PST
Thanks for the review.  Landed in r209018: <http://trac.webkit.org/r209018>.