Bug 213915

Summary: [JSC] Add exception checks in JSStringBuilder and Array#join
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Yusuke Suzuki 2020-07-02 19:51:11 PDT
[JSC] Add exception checks in JSStringBuilder and Array#join
Comment 1 Yusuke Suzuki 2020-07-02 19:53:00 PDT
Created attachment 403434 [details]
Patch
Comment 2 Yusuke Suzuki 2020-07-02 19:53:02 PDT
<rdar://problem/64878225>
Comment 3 Saam Barati 2020-07-02 19:57:23 PDT
Comment on attachment 403434 [details]
Patch

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

> Source/JavaScriptCore/runtime/JSStringJoiner.h:169
> +        return;

do we really need this?
Comment 4 Yusuke Suzuki 2020-07-02 20:12:04 PDT
Comment on attachment 403434 [details]
Patch

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

>> Source/JavaScriptCore/runtime/JSStringJoiner.h:169
>> +        return;
> 
> do we really need this?

Since we call `scope.release()`, returning here is better I think. Even if we add a new code after this if branch, then it should work well :)
Comment 5 Mark Lam 2020-07-02 20:55:46 PDT
Comment on attachment 403434 [details]
Patch

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

>>> Source/JavaScriptCore/runtime/JSStringJoiner.h:169
>>> +        return;
>> 
>> do we really need this?
> 
> Since we call `scope.release()`, returning here is better I think. Even if we add a new code after this if branch, then it should work well :)

Could you have done `RELEASE_AND_RETURN(append(jsString->viewWithUnderlyingString(globalObject)));` instead?
Comment 6 Yusuke Suzuki 2020-07-02 22:35:48 PDT
Comment on attachment 403434 [details]
Patch

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

>>>> Source/JavaScriptCore/runtime/JSStringJoiner.h:169
>>>> +        return;
>>> 
>>> do we really need this?
>> 
>> Since we call `scope.release()`, returning here is better I think. Even if we add a new code after this if branch, then it should work well :)
> 
> Could you have done `RELEASE_AND_RETURN(append(jsString->viewWithUnderlyingString(globalObject)));` instead?

Changed.
Comment 7 Yusuke Suzuki 2020-07-02 22:42:17 PDT
Created attachment 403441 [details]
Patch
Comment 8 EWS 2020-07-03 02:18:50 PDT
Committed r263889: <https://trac.webkit.org/changeset/263889>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 403441 [details].