Changeset 224072 in webkit


Ignore:
Timestamp:
Oct 26, 2017 5:31:50 PM (6 years ago)
Author:
msaboff@apple.com
Message:

REGRESSION(r222601): We fail to properly backtrack into a sub pattern of a parenthesis with non-zero minimum
https://bugs.webkit.org/show_bug.cgi?id=178890

Reviewed by Keith Miller.

JSTests:

New regression test.

  • stress/regress-178890.js: Added.

Source/JavaScriptCore:

We need to let a contained subpattern backtrack before declaring that the containing
parenthesis doesn't match. If the subpattern fails to match backtracking, then we
can check to see if we trying to backtrack below the minimum match count.

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::backtrackParentheses):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r224055 r224072  
     12017-10-26  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION(r222601): We fail to properly backtrack into a sub pattern of a parenthesis with non-zero minimum
     4        https://bugs.webkit.org/show_bug.cgi?id=178890
     5
     6        Reviewed by Keith Miller.
     7
     8        New regression test.
     9
     10        * stress/regress-178890.js: Added.
     11
    1122017-10-26  Mark Lam  <mark.lam@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r224055 r224072  
     12017-10-26  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION(r222601): We fail to properly backtrack into a sub pattern of a parenthesis with non-zero minimum
     4        https://bugs.webkit.org/show_bug.cgi?id=178890
     5
     6        Reviewed by Keith Miller.
     7
     8        We need to let a contained subpattern backtrack before declaring that the containing
     9        parenthesis doesn't match.  If the subpattern fails to match backtracking, then we
     10        can check to see if we trying to backtrack below the minimum match count.
     11       
     12        * yarr/YarrInterpreter.cpp:
     13        (JSC::Yarr::Interpreter::backtrackParentheses):
     14
    1152017-10-26  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r223081 r224072  
    11111111
    11121112        case QuantifierGreedy: {
    1113             if (backTrack->matchAmount == term.atom.quantityMinCount)
     1113            if (!backTrack->matchAmount)
    11141114                return JSRegExpNoMatch;
    11151115
     
    11371137                freeParenthesesDisjunctionContext(context);
    11381138
    1139                 if (result != JSRegExpNoMatch)
     1139                if (result != JSRegExpNoMatch || backTrack->matchAmount < term.atom.quantityMinCount)
    11401140                    return result;
    11411141            }
Note: See TracChangeset for help on using the changeset viewer.