| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index f0cb75ac46f36740ffb963da2fbb59767b151378..0b1509a4823c6ce947a31fdd276ab212ea360ff0 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;
|
|
|