mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibRegex: Avoid using GenericLexer::consume() when at eof
Fixes #10027.
This commit is contained in:
parent
047c013be0
commit
8e3fe80c06
Notes:
sideshowbarker
2024-07-18 03:57:41 +09:00
Author: https://github.com/alimpfard
Commit: 8e3fe80c06
Pull-request: https://github.com/SerenityOS/serenity/pull/10030
Issue: https://github.com/SerenityOS/serenity/issues/10027
Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue