Index: test/cctest/wasm/test-run-wasm-module.cc |
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc |
index a9694b4882eda999d762482112fb09adb5d4bd36..4345a35894a33113c36da71be59ceb741b8a429a 100644 |
--- a/test/cctest/wasm/test-run-wasm-module.cc |
+++ b/test/cctest/wasm/test-run-wasm-module.cc |
@@ -328,8 +328,9 @@ class WasmSerializationTest { |
v8::Local<v8::String> uncompiled_bytes = |
v8_compiled_module->GetWasmWireBytes(); |
bytes_size = static_cast<size_t>(uncompiled_bytes->Length()); |
- bytes = zone()->NewArray<uint8_t>(uncompiled_bytes->Length()); |
- uncompiled_bytes->WriteOneByte(bytes); |
+ bytes = zone()->NewArray<uint8_t>(bytes_size); |
+ uncompiled_bytes->WriteOneByte(bytes, 0, uncompiled_bytes->Length(), |
+ v8::String::NO_NULL_TERMINATION); |
// keep alive data_ until the end |
data_ = v8_compiled_module->Serialize(); |
} |