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
commit 1a173be29d
Notes: sideshowbarker 2024-07-18 05:40:34 +09:00
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;