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

Unified Diff: src/snapshot/serialize.cc

Issue 1170723003: Only mark checksummed memory as initialized for MSAN. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.cc
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
index 4be1da2c9a346f6f6f8d5acbb64837e227efe055..ace8225b8246caf958f3bf335b2c33c423e19576 100644
--- a/src/snapshot/serialize.cc
+++ b/src/snapshot/serialize.cc
@@ -2128,10 +2128,6 @@ int Serializer::ObjectSerializer::OutputRawData(
if (is_code_object_) object_start = PrepareCode();
const char* description = is_code_object_ ? "Code" : "Byte";
-#ifdef MEMORY_SANITIZER
- // Object sizes are usually rounded up with uninitialized padding space.
- MSAN_MEMORY_IS_INITIALIZED(object_start + base, bytes_to_output);
-#endif // MEMORY_SANITIZER
sink_->PutRaw(object_start + base, bytes_to_output, description);
}
if (to_skip != 0 && return_skip == kIgnoringReturn) {
@@ -2518,6 +2514,11 @@ Vector<const byte> SnapshotData::Payload() const {
class Checksum {
public:
explicit Checksum(Vector<const byte> payload) {
+#ifdef MEMORY_SANITIZER
+ // Computing the checksum includes padding bytes for objects like strings.
+ // Mark every object as initialized in the code serializer.
+ MSAN_MEMORY_IS_INITIALIZED(payload.start(), payload.length());
+#endif // MEMORY_SANITIZER
// Fletcher's checksum. Modified to reduce 64-bit sums to 32-bit.
uintptr_t a = 1;
uintptr_t b = 0;
« 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