Skip to content
Permalink
Browse files
Yarr::Parser::tryConsumeGroupName() should check for the end of the p…
…attern.

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):



Canonical link: https://commits.webkit.org/193873@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mark Lam committed Sep 27, 2017
1 parent 6131eff commit ac8e6e36983f5fb1f98decdddd975e01c34d28c4
Showing with 34 additions and 15 deletions.
  1. +10 −0 JSTests/ChangeLog
  2. +1 −0 JSTests/stress/regress-177423.js
  3. +11 −0 Source/JavaScriptCore/ChangeLog
  4. +12 −15 Source/JavaScriptCore/yarr/YarrParser.h
@@ -1,3 +1,13 @@
2017-09-27 Mark Lam <mark.lam@apple.com>

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.

* stress/regress-177423.js: Added.

2017-09-27 Yusuke Suzuki <utatane.tea@gmail.com>

Add Above/Below comparisons for UInt32 patterns
@@ -0,0 +1 @@
/\k</
@@ -1,3 +1,14 @@
2017-09-27 Mark Lam <mark.lam@apple.com>

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.

* yarr/YarrParser.h:
(JSC::Yarr::Parser::tryConsumeGroupName):

2017-09-27 Yusuke Suzuki <utatane.tea@gmail.com>

Unreviewed, fix x86 breaking due to exhausted registers
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009, 2014-2016 Apple Inc. All rights reserved.
* Copyright (C) 2009-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -999,22 +999,19 @@ class Parser {
std::optional<String> tryConsumeGroupName()
{
ParseState state = saveState();
StringBuilder identifierBuilder;

int ch = tryConsumeIdentifierCharacter();

if (isIdentifierStart(ch)) {
StringBuilder identifierBuilder;

do {
identifierBuilder.append(ch);
ch = tryConsumeIdentifierCharacter();
if (ch == '>') {
while (!atEndOfPattern()) {
int ch = tryConsumeIdentifierCharacter();
if (ch == '>') {
if (identifierBuilder.length())
return std::optional<String>(identifierBuilder.toString());
break;
}
if (!isIdentifierPart(ch))
break;
} while (!atEndOfPattern());
break;
}
if (!isIdentifierPart(ch))
break;

identifierBuilder.append(ch);
}

restoreState(state);

0 comments on commit ac8e6e3

Please sign in to comment.