Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 5636d826064c44024bbdef0bc7eaeb81177c6457..542ec28bb695a209682437b4764101d3b898cf7e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -16225,7 +16225,7 @@ JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) { |
JSRegExp::Flags value = JSRegExp::kNone; |
int length = flags->length(); |
// A longer flags string cannot be valid. |
- if (length > 5) return JSRegExp::Flags(0); |
+ if (length > JSRegExp::FlagCount()) return JSRegExp::Flags(0); |
for (int i = 0; i < length; i++) { |
JSRegExp::Flag flag = JSRegExp::kNone; |
switch (flags->Get(i)) { |