Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 2cf8aba18e8413e814c1d4d42608cfc4250abf04..23193b3e03ded1ccc2a62f198d0767520e7d655c 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -1666,7 +1666,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExec) { |
RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) { |
ASSERT(args.length() == 3); |
CONVERT_SMI_ARG_CHECKED(elements_count, 0); |
- if (elements_count > JSArray::kMaxFastElementsLength) { |
+ if (elements_count < 0 || |
+ elements_count > FixedArray::kMaxLength || |
+ !Smi::IsValid(elements_count)) { |
return isolate->ThrowIllegalOperation(); |
} |
Object* new_object; |