Index: src/runtime/runtime-typedarray.cc |
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc |
index b95d20f1ddb7113af4d724a59b6aa9515aff7304..93ff56dbf7b9c9ec250643cf7eefdabe4ef24dd3 100644 |
--- a/src/runtime/runtime-typedarray.cc |
+++ b/src/runtime/runtime-typedarray.cc |
@@ -241,7 +241,9 @@ RUNTIME_FUNCTION(Runtime_TypedArrayInitialize) { |
JSObject::SetMapAndElements(holder, map, elements); |
DCHECK(IsExternalArrayElementsKind(holder->map()->elements_kind())); |
} else { |
- holder->set_buffer(Smi::FromInt(0)); |
+ Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); |
+ Runtime::SetupArrayBuffer(isolate, buffer, true, NULL, byte_length); |
+ holder->set_buffer(*buffer); |
Handle<FixedTypedArrayBase> elements = |
isolate->factory()->NewFixedTypedArray(static_cast<int>(length), |
array_type); |