1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibRegex: Error out on Eof when parsing nonempty class range elements

Fixes #22507.
This commit is contained in:
Ali Mohammad Pur 2023-12-31 17:44:44 +03:30 committed by Andreas Kling
parent ee3d09f225
commit 267040dde7
2 changed files with 18 additions and 0 deletions

View file

@ -1963,6 +1963,11 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>&
return {};
}
if (match(TokenType::Eof)) {
set_error(Error::MismatchingBracket);
return {};
}
if (match(TokenType::RightBracket) || match(TokenType::HyphenMinus))
return {};