Commit dd1e2e84 authored by hans's avatar hans Committed by Commit bot

Tell MSan to ignore uninitialized padding when writing snapshots

After r299061, MSan started complaining about uninitialized data in
fwrite.

BUG=chromium:710152

Review-Url: https://codereview.chromium.org/2808253002
Cr-Commit-Position: refs/heads/master@{#44587}
parent 76f0a91c
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "src/base/platform/platform.h" #include "src/base/platform/platform.h"
#include "src/flags.h" #include "src/flags.h"
#include "src/list.h" #include "src/list.h"
#include "src/msan.h"
#include "src/snapshot/natives.h" #include "src/snapshot/natives.h"
#include "src/snapshot/partial-serializer.h" #include "src/snapshot/partial-serializer.h"
#include "src/snapshot/startup-serializer.h" #include "src/snapshot/startup-serializer.h"
...@@ -34,6 +35,10 @@ class SnapshotWriter { ...@@ -34,6 +35,10 @@ class SnapshotWriter {
// we end up with a corrupted snapshot file. The build step would succeed, // 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 // but the build target is unusable. Ideally we would write out temporary
// files and only move them to the final destination as last step. // 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( i::Vector<const i::byte> blob_vector(
reinterpret_cast<const i::byte*>(blob.data), blob.raw_size); reinterpret_cast<const i::byte*>(blob.data), blob.raw_size);
MaybeWriteSnapshotFile(blob_vector); MaybeWriteSnapshotFile(blob_vector);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment