summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibRegex/RegexParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibRegex/RegexParser.cpp b/Libraries/LibRegex/RegexParser.cpp
index 485a0902d6..785084ca0f 100644
--- a/Libraries/LibRegex/RegexParser.cpp
+++ b/Libraries/LibRegex/RegexParser.cpp
@@ -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;