Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: src/d8.cc

Issue 1210623002: Fix cluster-fuzz regression with Workers when serializing empty string (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-503991.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 333f7e440274b2334ace286e7be5e46064fa3959..4133283f1c4c6e7695cda898dc8c408eb0c82590 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -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);
+ }
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-503991.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698