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

Unified Diff: src/snapshot/mksnapshot.cc

Issue 2808253002: Tell MSan to ignore uninitialized padding when writing snapshots (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/mksnapshot.cc
diff --git a/src/snapshot/mksnapshot.cc b/src/snapshot/mksnapshot.cc
index 479fbd41a96ce56baeb1ff2c2cc1edc8208a0725..683654930bd6061360985c90e21712c75cfeb2b7 100644
--- a/src/snapshot/mksnapshot.cc
+++ b/src/snapshot/mksnapshot.cc
@@ -11,6 +11,7 @@
#include "src/base/platform/platform.h"
#include "src/flags.h"
#include "src/list.h"
+#include "src/msan.h"
#include "src/snapshot/natives.h"
#include "src/snapshot/partial-serializer.h"
#include "src/snapshot/startup-serializer.h"
@@ -34,6 +35,10 @@ class SnapshotWriter {
// we end up with a corrupted snapshot file. The build step would succeed,
// but the build target is unusable. Ideally we would write out temporary
// files and only move them to the final destination as last step.
+
+ // Tell MSan to ignore uninitialized padding in the blob.
+ MSAN_MEMORY_IS_INITIALIZED(blob.data, blob.raw_size);
+
i::Vector<const i::byte> blob_vector(
reinterpret_cast<const i::byte*>(blob.data), blob.raw_size);
MaybeWriteSnapshotFile(blob_vector);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698