[webkit-changes] [WebKit/WebKit] 6a323d: REGRESSION(260692 at main) 14 Test262 tests fail afte...

Michael Saboff noreply at github.com
Wed Mar 8 22:26:46 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a323d41f6f0fd052e9daf911fc4b009ad8d1213
      https://github.com/WebKit/WebKit/commit/6a323d41f6f0fd052e9daf911fc4b009ad8d1213
  Author: Michael Saboff <msaboff at apple.com>
  Date:   2023-03-08 (Wed, 08 Mar 2023)

  Changed paths:
    M JSTests/stress/regexp-duplicate-named-captures.js
    M Source/JavaScriptCore/runtime/RegExp.cpp
    M Source/JavaScriptCore/runtime/RegExp.h
    M Source/JavaScriptCore/yarr/YarrPattern.cpp
    M Source/JavaScriptCore/yarr/YarrPattern.h

  Log Message:
  -----------
  REGRESSION(260692 at main) 14 Test262 tests fail after this this change
https://bugs.webkit.org/show_bug.cgi?id=253573
rdar://106430729

Reviewed by Ross Kirsling.

This fixes three issues introduced in 260692 at main:
 1. Improper handling of non-duplicate named groups.  For the case where a non-duplicate
    group appears between two duplicate named groups, the non-duplicate group's match is
    accessed as a duplicate named group, by using it's subpatternId to index into the
    duplicate named group indirect area of the output vector.  This could exceed the range
    of the vector, but always provided the wrong result.  This was fixed by restructuring
    the capture group for name processing in both the renamed addCaptureGroupForName() and
    existing setupNamedCaptures().
 2. When parsing a named back reference where the references subpattern may not have been
    closed, we need to do the same analysis we find for numbered back references as found
    in atomBackReference.  That is searching for an unclosed capture parenthesis that
    contains the current back reference.
 3. We shouldn't try to convert forward references in a lookbehind when an alternative is
    complete as that is premature.  Waiting for the lookbehind assertion is sufficient.

Updated the regexp-duplicate-named-captures.js test, including the group equality checking.

Also renamed the variables *indeces* => *indices*.

* JSTests/stress/regexp-duplicate-named-captures.js:
(testRegExp):
* Source/JavaScriptCore/runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
* Source/JavaScriptCore/runtime/RegExp.h:
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::addCaptureGroupForName):
(JSC::Yarr::YarrPatternConstructor::tryConvertingForwardReferencesToBackreferences):
(JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin):
(JSC::Yarr::YarrPatternConstructor::atomNamedBackReference):
(JSC::Yarr::YarrPatternConstructor::disjunction):
(JSC::Yarr::YarrPatternConstructor::setupNamedCaptures):
(JSC::Yarr::YarrPattern::compile):
(JSC::Yarr::YarrPattern::YarrPattern):
(JSC::Yarr::YarrPatternConstructor::namedCaptureGroupIdForName): Deleted.
(JSC::Yarr::YarrPatternConstructor::setupDuplicateNamedCaptures): Deleted.
* Source/JavaScriptCore/yarr/YarrPattern.h:
(JSC::Yarr::YarrPattern::resetForReparsing):

Canonical link: https://commits.webkit.org/261405@main




More information about the webkit-changes mailing list