Bug 222157 - Minor fixes to RegExp match indices after r273086
Summary: Minor fixes to RegExp match indices after r273086
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
: 222278 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-18 20:48 PST by Michael Saboff
Modified: 2021-02-22 10:56 PST (History)
8 users (show)

See Also:


Attachments
Patch (5.81 KB, patch)
2021-02-18 20:58 PST, Michael Saboff
ysuzuki: review+
Details | Formatted Diff | Diff
Added local versions of updated but unmarked test262 match-indices test (36.92 KB, patch)
2021-02-19 11:07 PST, Michael Saboff
ysuzuki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2021-02-18 20:48:58 PST
Through code inspection found an array size bug in RegExpPrototype.cpp.
Also found a compliance bug when populating the "groups" property for indices when there aren't any named groups.  In that case "groups" should be undefined instead on non-existent.
Comment 1 Michael Saboff 2021-02-18 20:57:33 PST
<rdar://problem/74497629>
Comment 2 Michael Saboff 2021-02-18 20:58:18 PST
Created attachment 420915 [details]
Patch
Comment 3 Yusuke Suzuki 2021-02-18 21:00:27 PST
Comment on attachment 420915 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/RegExpMatchesArray.h:109
> +            indicesArray->putDirect(vm, RegExpMatchesIndicesGroupsPropertyOffset, indicesGroups ? indicesGroups : jsUndefined());

Can you add a test for this change?
Comment 4 Yusuke Suzuki 2021-02-18 21:09:33 PST
Comment on attachment 420915 [details]
Patch

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

> Source/JavaScriptCore/runtime/RegExpPrototype.cpp:165
> +typedef std::array<char, 7 + 1> FlagsString; // 6 different flags and a null character terminator.

/6 different flags/7 different flags/
Comment 5 Michael Saboff 2021-02-19 11:07:24 PST
Created attachment 420993 [details]
Added local versions of updated but unmarked test262 match-indices test
Comment 6 Michael Saboff 2021-02-19 11:14:19 PST
(In reply to Michael Saboff from comment #5)
> Created attachment 420993 [details]
> Added local versions of updated but unmarked test262 match-indices test

That should be "Added local versions of updated but unmerged test262 match-indices tests."
Comment 7 Yusuke Suzuki 2021-02-19 11:16:07 PST
Comment on attachment 420993 [details]
Added local versions of updated but unmarked test262 match-indices test

r=me
Comment 8 Michael Saboff 2021-02-19 12:50:51 PST
Committed r273160 (234355@main): <https://commits.webkit.org/234355@main>
Comment 9 Robin Morisset 2021-02-22 10:56:04 PST
*** Bug 222278 has been marked as a duplicate of this bug. ***