Bug 165022 - Fix exception scope verification failures in runtime/JSGenericTypedArrayView* files.
Summary: Fix exception scope verification failures in runtime/JSGenericTypedArrayView*...
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-21 20:00 PST by Mark Lam
Modified: 2016-11-28 15:36 PST (History)
7 users (show)

See Also:


Attachments
proposed patch. (11.68 KB, patch)
2016-11-21 20:05 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-21 20:00:52 PST
Patch coming.
Comment 1 Mark Lam 2016-11-21 20:05:47 PST
Created attachment 295324 [details]
proposed patch.
Comment 2 Saam Barati 2016-11-28 14:18:34 PST
Comment on attachment 295324 [details]
proposed patch.

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

> Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:470
> +        scope.release();

Why not put the scope.release() before the switch and also keep the old return statement?
Comment 3 Mark Lam 2016-11-28 15:27:24 PST
Comment on attachment 295324 [details]
proposed patch.

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

>> Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:470
>> +        scope.release();
> 
> Why not put the scope.release() before the switch and also keep the old return statement?

Because we want the scope.release() near the return statement.  Having it before the switch increases the opportunity for new code to be inadvertantly added between the scope.release() and the switch.
Comment 4 Mark Lam 2016-11-28 15:35:17 PST
(In reply to comment #3)
> Comment on attachment 295324 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=295324&action=review
> 
> >> Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:470
> >> +        scope.release();
> > 
> > Why not put the scope.release() before the switch and also keep the old return statement?
> 
> Because we want the scope.release() near the return statement.  Having it
> before the switch increases the opportunity for new code to be inadvertantly
> added between the scope.release() and the switch.

Saam pointed out to me offline that if we have 2 ThrowScopes between the scope.release() and the return, the 2nd ThrowScope will catch the unhandled exception from the first.  So, my reasoning above does not apply.

Anyway, I'll leave it as is for this patch because it does make it easier to see the return that corresponds to the scope.release().
Comment 5 Mark Lam 2016-11-28 15:36:08 PST
Thanks for the review.  Landed in r209031: <http://trac.webkit.org/r209031>.