Bug 213915 - [JSC] Add exception checks in JSStringBuilder and Array#join
Summary: [JSC] Add exception checks in JSStringBuilder and Array#join
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-02 19:51 PDT by Yusuke Suzuki
Modified: 2020-07-03 02:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.75 KB, patch)
2020-07-02 19:53 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (4.27 KB, patch)
2020-07-02 22:42 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].