summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/yarr/YarrParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/yarr/YarrParser.h')
-rw-r--r--Source/JavaScriptCore/yarr/YarrParser.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/yarr/YarrParser.h b/Source/JavaScriptCore/yarr/YarrParser.h
index e6694560a..1182d7907 100644
--- a/Source/JavaScriptCore/yarr/YarrParser.h
+++ b/Source/JavaScriptCore/yarr/YarrParser.h
@@ -54,6 +54,7 @@ private:
PatternTooLarge,
QuantifierOutOfOrder,
QuantifierWithoutAtom,
+ QuantifierTooLarge,
MissingParentheses,
ParenthesesUnmatched,
ParenthesesTypeInvalid,
@@ -546,6 +547,11 @@ private:
ASSERT(!m_err);
ASSERT(min <= max);
+ if (min == UINT_MAX) {
+ m_err = QuantifierTooLarge;
+ return;
+ }
+
if (lastTokenWasAnAtom)
m_delegate.quantifyAtom(min, max, !tryConsume('?'));
else
@@ -685,6 +691,7 @@ private:
REGEXP_ERROR_PREFIX "regular expression too large",
REGEXP_ERROR_PREFIX "numbers out of order in {} quantifier",
REGEXP_ERROR_PREFIX "nothing to repeat",
+ REGEXP_ERROR_PREFIX "number too large in {} quantifier",
REGEXP_ERROR_PREFIX "missing )",
REGEXP_ERROR_PREFIX "unmatched parentheses",
REGEXP_ERROR_PREFIX "unrecognized character after (?",
@@ -696,7 +703,6 @@ private:
return errorMessages[m_err];
}
-
// Misc helper functions:
typedef unsigned ParseState;