mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
LibRegex: Account for extra explicit And/Or in class parser assertion
Fixes #23691.
This commit is contained in:
parent
259a84ddac
commit
27a38932da
Notes:
sideshowbarker
2024-07-17 04:01:41 +09:00
Author: https://github.com/alimpfard
Commit: 27a38932da
Pull-request: https://github.com/SerenityOS/serenity/pull/23694
Issue: https://github.com/SerenityOS/serenity/issues/23691
2 changed files with 7 additions and 1 deletions
|
@ -2386,7 +2386,12 @@ bool ECMA262Parser::parse_nested_class(Vector<regex::CompareTypeAndValuePair>& c
|
|||
if (match(TokenType::RightBracket)) {
|
||||
consume();
|
||||
// Should only have at most an 'Inverse' (after an 'Or')
|
||||
VERIFY(compares.size() <= 2);
|
||||
if (m_parser_state.regex_options.has_flag_set(regex::AllFlags::UnicodeSets)) {
|
||||
// In unicode sets mode, we can have an additional 'And'/'Or' before the 'Inverse'.
|
||||
VERIFY(compares.size() <= 3);
|
||||
} else {
|
||||
VERIFY(compares.size() <= 2);
|
||||
}
|
||||
compares.append(CompareTypeAndValuePair { CharacterCompareType::EndAndOr, 0 });
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue