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

LibRegex: Generate a 'Compare' op for empty character classes

Otherwise it would match zero-length strings.
Fixes #6256.
This commit is contained in:
AnotherTest 2021-04-12 10:58:59 +04:30 committed by Andreas Kling
parent 7c98a6be17
commit 5a14f7ea2f
2 changed files with 15 additions and 0 deletions

View file

@ -1418,6 +1418,9 @@ bool ECMA262Parser::parse_character_class(ByteCode& stack, size_t& match_length_
if (match(TokenType::RightBracket)) {
consume();
// Should only have at most an 'Inverse'
VERIFY(compares.size() <= 1);
stack.insert_bytecode_compare_values(move(compares));
return true;
}