| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 15cfc854bfad6501cab80faed3743f81663fc629..7f37af0bd7241ee0cbbc1eee0d97e4b5b2cfb676 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -961,12 +961,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TypedArrayInitializeFromArrayLike) {
|
|
|
| Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer();
|
| size_t length = NumberToSize(isolate, *length_obj);
|
| - size_t byte_length = length * element_size;
|
| - if (byte_length < length) { // Overflow
|
| + if (length > (kMaxInt / element_size)) {
|
| return isolate->Throw(*isolate->factory()->
|
| NewRangeError("invalid_array_buffer_length",
|
| HandleVector<Object>(NULL, 0)));
|
| }
|
| + size_t byte_length = length * element_size;
|
|
|
| // NOTE: not initializing backing store.
|
| // We assume that the caller of this function will initialize holder
|
|
|