LibRegex: Avoid using GenericLexer::consume() when at eof

Fixes #10027.
This commit is contained in:
Ali Mohammad Pur 2021-09-14 19:44:38 +04:30 committed by Andreas Kling
commit 8e3fe80c06
Notes: sideshowbarker 2024-07-18 03:57:41 +09:00

View file

@ -2229,6 +2229,7 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis()
}
break;
case '(':
lexer.consume();
if (lexer.consume_specific('?')) {
// non-capturing group '(?:', lookaround '(?<='/'(?<!', or named capture '(?<'
if (!lexer.consume_specific('<'))
@ -2242,8 +2243,10 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis()
++count;
}
break;
default:
lexer.consume();
break;
}
lexer.consume();
}
m_total_number_of_capturing_parenthesis = count;