Fix cluster-fuzz regression with Workers when serializing empty string
BUG=chromium:503991 R=jochen@chromium.org LOG=n Review URL: https://codereview.chromium.org/1210623002 Cr-Commit-Position: refs/heads/master@{#29263}
This commit is contained in:
parent
edcc242a44
commit
b3bd7289f7
@ -1538,8 +1538,10 @@ void SerializationData::WriteTag(SerializationTag tag) { data.Add(tag); }
|
||||
|
||||
|
||||
void SerializationData::WriteMemory(const void* p, int length) {
|
||||
i::Vector<uint8_t> block = data.AddBlock(0, length);
|
||||
memcpy(&block[0], p, length);
|
||||
if (length > 0) {
|
||||
i::Vector<uint8_t> block = data.AddBlock(0, length);
|
||||
memcpy(&block[0], p, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
10
test/mjsunit/regress/regress-crbug-503991.js
Normal file
10
test/mjsunit/regress/regress-crbug-503991.js
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2015 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
if (this.Worker) {
|
||||
__v_3 = "";
|
||||
function __f_1() {}
|
||||
var __v_6 = new Worker(__f_1);
|
||||
__v_6.postMessage(__v_3);
|
||||
}
|
Loading…
Reference in New Issue
Block a user