mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibRegex: Stop trying to read a character class when no tokens remain
e.g. in "[". Fixes #4186.
This commit is contained in:
parent
2adcdbcc1e
commit
e83e7a03c2
Notes:
sideshowbarker
2024-07-19 01:13:50 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/e83e7a03c24 Pull-request: https://github.com/SerenityOS/serenity/pull/4194 Issue: https://github.com/SerenityOS/serenity/issues/4186 Issue: https://github.com/SerenityOS/serenity/issues/4189
1 changed files with 5 additions and 0 deletions
|
@ -1236,6 +1236,11 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>&
|
|||
};
|
||||
|
||||
while (!match(TokenType::RightBracket)) {
|
||||
if (match(TokenType::Eof)) {
|
||||
set_error(Error::MismatchingBracket);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto first_atom = read_class_atom();
|
||||
if (!first_atom.has_value())
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue