mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibRegex: Disallow unescaped quantifiers in Unicode mode
This commit is contained in:
parent
c3e1f1f687
commit
1a173be29d
Notes:
sideshowbarker
2024-07-18 05:40:34 +09:00
Author: https://github.com/trflynn89
Commit: 1a173be29d
Pull-request: https://github.com/SerenityOS/serenity/pull/9367
Reviewed-by: https://github.com/linusg ✅
2 changed files with 9 additions and 0 deletions
|
@ -1290,6 +1290,9 @@ bool ECMA262Parser::parse_atom(ByteCode& stack, size_t& match_length_minimum, bo
|
|||
}
|
||||
|
||||
if (match(TokenType::RightBracket) || match(TokenType::RightCurly) || match(TokenType::LeftCurly)) {
|
||||
if (unicode)
|
||||
return set_error(Error::InvalidPattern);
|
||||
|
||||
if (m_should_use_browser_extended_grammar) {
|
||||
auto token = consume();
|
||||
match_length_minimum += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue