Changeset 222586 in webkit


Ignore:
Timestamp:
Sep 27, 2017 4:58:33 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

Yarr::Parser::tryConsumeGroupName() should check for the end of the pattern.
https://bugs.webkit.org/show_bug.cgi?id=177423
<rdar://problem/34621320>

Reviewed by Keith Miller.

JSTests:

  • stress/regress-177423.js: Added.

Source/JavaScriptCore:

  • yarr/YarrParser.h:

(JSC::Yarr::Parser::tryConsumeGroupName):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r222564 r222586  
     12017-09-27  Mark Lam  <mark.lam@apple.com>
     2
     3        Yarr::Parser::tryConsumeGroupName() should check for the end of the pattern.
     4        https://bugs.webkit.org/show_bug.cgi?id=177423
     5        <rdar://problem/34621320>
     6
     7        Reviewed by Keith Miller.
     8
     9        * stress/regress-177423.js: Added.
     10
    1112017-09-27  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r222581 r222586  
     12017-09-27  Mark Lam  <mark.lam@apple.com>
     2
     3        Yarr::Parser::tryConsumeGroupName() should check for the end of the pattern.
     4        https://bugs.webkit.org/show_bug.cgi?id=177423
     5        <rdar://problem/34621320>
     6
     7        Reviewed by Keith Miller.
     8
     9        * yarr/YarrParser.h:
     10        (JSC::Yarr::Parser::tryConsumeGroupName):
     11
    1122017-09-27  Yusuke Suzuki  <utatane.tea@gmail.com>
    213
  • trunk/Source/JavaScriptCore/yarr/YarrParser.h

    r221769 r222586  
    11/*
    2  * Copyright (C) 2009, 2014-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    10001000    {
    10011001        ParseState state = saveState();
    1002 
    1003         int ch = tryConsumeIdentifierCharacter();
    1004 
    1005         if (isIdentifierStart(ch)) {
    1006             StringBuilder identifierBuilder;
    1007 
    1008             do {
    1009                 identifierBuilder.append(ch);
    1010                 ch = tryConsumeIdentifierCharacter();
    1011                 if (ch == '>') {
     1002        StringBuilder identifierBuilder;
     1003
     1004        while (!atEndOfPattern()) {
     1005            int ch = tryConsumeIdentifierCharacter();
     1006            if (ch == '>') {
     1007                if (identifierBuilder.length())
    10121008                    return std::optional<String>(identifierBuilder.toString());
    1013                     break;
    1014                 }
    1015                 if (!isIdentifierPart(ch))
    1016                     break;
    1017             } while (!atEndOfPattern());
     1009                break;
     1010            }
     1011            if (!isIdentifierPart(ch))
     1012                break;
     1013
     1014            identifierBuilder.append(ch);
    10181015        }
    10191016
Note: See TracChangeset for help on using the changeset viewer.