Bug 164964

Summary: Fix missing exception checks in Interpreter.cpp.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, ggaren, jfbastien, keith_miller, msaboff, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 162351    
Attachments:
Description Flags
proposed patch.
none
proposed patch: updated to use return { } where possible.
saam: review+
Re-based patch for landing. none

Description Mark Lam 2016-11-18 15:44:27 PST
Patch coming.
Comment 1 Mark Lam 2016-11-18 15:49:45 PST
Created attachment 295204 [details]
proposed patch.
Comment 2 Mark Lam 2016-11-21 11:54:09 PST
Created attachment 295308 [details]
proposed patch: updated to use return { } where possible.
Comment 3 Saam Barati 2016-11-21 15:18:03 PST
Comment on attachment 295308 [details]
proposed patch: updated to use return { } where possible.

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

> Source/JavaScriptCore/interpreter/Interpreter.cpp:140
> +                    scope.release();

Why wouldn't this be an ASSERT(!scope.exception())?
Seems weird to have it be successful and throw an exception.

> Source/JavaScriptCore/interpreter/Interpreter.cpp:146
> +                    scope.release();

Ditto
Comment 4 Mark Lam 2017-03-15 11:29:25 PDT
Comment on attachment 295308 [details]
proposed patch: updated to use return { } where possible.

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

>> Source/JavaScriptCore/interpreter/Interpreter.cpp:140
>> +                    scope.release();
> 
> Why wouldn't this be an ASSERT(!scope.exception())?
> Seems weird to have it be successful and throw an exception.

The literal parser allocates objects, and can therefore throw OutOfMemoryErrors, StackOverflowErrors, etc.

I'm going to update and land this patch.
Comment 5 Mark Lam 2017-03-15 11:58:25 PDT
Created attachment 304522 [details]
Re-based patch for landing.
Comment 6 Radar WebKit Bug Importer 2017-03-15 13:17:18 PDT
<rdar://problem/31071591>
Comment 7 Mark Lam 2017-03-15 13:20:46 PDT
Thanks for the review.  Landed in r214005: <http://trac.webkit.org/r214005>.