diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibRegex/RegexParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp index e50db2a5b2..da2225348a 100644 --- a/Userland/Libraries/LibRegex/RegexParser.cpp +++ b/Userland/Libraries/LibRegex/RegexParser.cpp @@ -497,7 +497,8 @@ bool PosixBasicParser::parse_one_char_or_collation_element(ByteCode& bytecode, s consume(TokenType::RightBracket, Error::MismatchingBracket); - bytecode.insert_bytecode_compare_values(move(values)); + if (!has_error()) + bytecode.insert_bytecode_compare_values(move(values)); match_length_minimum += bracket_minimum_length; return !has_error(); } @@ -617,7 +618,8 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_bracket_expression(ByteCode& stack if (!AbstractPosixParser::parse_bracket_expression(values, match_length_minimum)) return false; - stack.insert_bytecode_compare_values(move(values)); + if (!has_error()) + stack.insert_bytecode_compare_values(move(values)); return !has_error(); } |