1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibRegex: Disallow unescaped quantifiers in Unicode mode

This commit is contained in:
Timothy Flynn 2021-08-11 18:06:33 -04:00 committed by Linus Groh
parent c3e1f1f687
commit 1a173be29d
2 changed files with 9 additions and 0 deletions

View file

@ -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;