Bug 189185 - Fix exception check accounting in constructJSWebAssemblyCompileError().
Summary: Fix exception check accounting in constructJSWebAssemblyCompileError().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-31 00:06 PDT by Mark Lam
Modified: 2018-09-04 11:53 PDT (History)
7 users (show)

See Also:


Attachments
proposed patch. (3.54 KB, patch)
2018-08-31 00:15 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
Patch (987 bytes, patch)
2018-09-04 10:55 PDT, Dawei Fenton (:realdawei)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2018-08-31 00:06:21 PDT
<rdar://problem/39786007>
Comment 1 Mark Lam 2018-08-31 00:15:19 PDT
Created attachment 348616 [details]
proposed patch.
Comment 2 Michael Saboff 2018-08-31 09:47:15 PDT
Comment on attachment 348616 [details]
proposed patch.

r=me
Comment 3 WebKit Commit Bot 2018-08-31 10:12:39 PDT
Comment on attachment 348616 [details]
proposed patch.

Clearing flags on attachment: 348616

Committed r235558: <https://trac.webkit.org/changeset/235558>
Comment 4 WebKit Commit Bot 2018-08-31 10:12:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Saam Barati 2018-08-31 11:30:46 PDT
Comment on attachment 348616 [details]
proposed patch.

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

> Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp:51
> +        auto* error = JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error());

Why would creating the exception throw an exception?
Comment 6 Mark Lam 2018-08-31 14:01:41 PDT
(In reply to Saam Barati from comment #5)
> Comment on attachment 348616 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=348616&action=review
> 
> > Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp:51
> > +        auto* error = JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error());
> 
> Why would creating the exception throw an exception?

See "static JSWebAssemblyCompileError* create(ExecState* exec, VM& vm, Structure* structure, JSValue message)" in JSWebAssemblyCompileError.h.  It calls message.toWTFString(exec) which can throw.
Comment 7 Saam Barati 2018-08-31 14:54:39 PDT
(In reply to Mark Lam from comment #6)
> (In reply to Saam Barati from comment #5)
> > Comment on attachment 348616 [details]
> > proposed patch.
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=348616&action=review
> > 
> > > Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp:51
> > > +        auto* error = JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error());
> > 
> > Why would creating the exception throw an exception?
> 
> See "static JSWebAssemblyCompileError* create(ExecState* exec, VM& vm,
> Structure* structure, JSValue message)" in JSWebAssemblyCompileError.h.  It
> calls message.toWTFString(exec) which can throw.

Ok, makes sense.
Comment 8 Dawei Fenton (:realdawei) 2018-09-04 10:55:31 PDT
Reopening to attach new patch.
Comment 9 Dawei Fenton (:realdawei) 2018-09-04 10:55:32 PDT
Created attachment 348827 [details]
Patch
Comment 10 WebKit Commit Bot 2018-09-04 11:53:54 PDT
Comment on attachment 348827 [details]
Patch

Clearing flags on attachment: 348827

Committed r235624: <https://trac.webkit.org/changeset/235624>
Comment 11 WebKit Commit Bot 2018-09-04 11:53:55 PDT
All reviewed patches have been landed.  Closing bug.